News for hackers. Stuff that matters.

Ask HN: Hostname Conventions for Distributed Systems?

I've gone through a variety of hostnaming strategies over the years, and the one I use now is <service><##> (eg zookeeper01).

With distributed systems in particular, but any system in general, boxes can come and go, and I hate having holes in my names (eg zookeeper01, 02, 04, 05, 06). That, and by choosing the number of leading zeroes, you're guessing at the max number of servers this service will be served by.

How do people manage this? I'm thinking something like <service>-<random_token> (eg zookeeper-fi2) would make sense and be more scalable, but I'm interested in what strategies other people use.

(I'd create a poll but I don't have the 200 karma) =/

( 3 comments | 3 points | on HN )
Re:Ask HN: Hostname Conventions for Distributed Systems? by merinid on Wednesday January 16, 2013 @12:31PM (#5067880)
I like to think of everything as ephemeral. You can always write software for a new box to "fill in" holes when systems are replaced. I like this because it helps me when I assign roles or node based redundancy to my boxes.
Re:Ask HN: Hostname Conventions for Distributed Systems? by rellik on Wednesday January 16, 2013 @12:36PM (#5067920)
Yeah, the tokenized strategy is kinda going after the ephemeral nature of the boxes, which is why I like it. Do you use the numbered approach?
Re:Ask HN: Hostname Conventions for Distributed Systems? by merinid on Wednesday January 16, 2013 @12:58PM (#5068060)
Yes. Numbered approach, which I like because I can pack data in. So for instance: dbserver_01_n01. Which is the first node of the first db server. I have servers that are mostly used in read only and others which are write only. But their roles switch. We do all of the writing (not users), so it makes sense to split the namespacing this way.