Naming Servers - Best Practices
I am moving my site over to Linode and am currently planning on 1 web server, 1 mysql server and 1 mysql replication server.
I am naming them:
www-1
mysql-1
mysql-replication-1
I had a question about adding the number at the end. Would I be better of not using numbers and using a generic name, like
mysql-aristotle
wondering from people's experiences, if theres any instances where the number got in the way, such as swapping servers, etc…?
Otherwise, should I just keep them all generic names in case they will serve different functions later.
Thanks!
13 Replies
Only in big (or multiple) data centers are naming conventions with function/location names important.
RFC 1178wittetremensprima
I like the generic names in case you want to have the server be used for multiple functions, but when I'm looking at multiple terminals, it's nice to see the hostname referencing the purpose.
On a side note, the hostname on the local machine should be the same name (pointing to that ip) in the /etc/hosts file for the external servers?
Example:
Linode NJ + database + MySQL(01)
lnj-db-mysql01
Linode NJ + webserver + NGINX(01)
lnj-web-nginx01
I don't bother adding master, slave or replication for databases. In a master/slave setup it would just be:
lnj-db-mysql01
lnj-db-mysql02
01 is always the master.
Greek gods
Company-serverpurpose
Company-servernumber
I don't add location/provider in there since they're not constants (i.e. I've moved one server to 2 hosts in 3 DCs in the past two days while testing different providers)
Here is my two pence - I named my server using the initial of the full company name. Purpose based names also sounds a good practice.
I also differentiated the background colors of the terminals so in the end, the name didn't matter as much.
I chose names like: db01, db02, web01
It was interesting to add the location: lnj-db-01, mulling over if I need to add that. Does anyone keep linodes in multiple locations, does it serve any purpose other than as backup if the primary location goes down?
-Tim