tags:

views:

89

answers:

2

I want to have an EC2 based cluster that can grow and shrink at will. No node will be special in any way nor do I want them to have to coordinate their names with any other nodes. I don't want to hard code the names since I want to use one image and spin them up as needed. I understand nodes have to have names to communicate, though. What's a good strategy for automatically and dynamically coming up with a name at start script time?

A: 

Use uuidgen, or the equivalent API if your shell scripting language isn't (ba)sh. If you don't want to see single quotes around node names, then replace - with _ and add a prefix, just in case the first character is a decimal digit.

(Sorry, if I'm stating the obvious, but...) If you want the node to be discoverable, get the initialisation code to publish the node to some kind of directory service node.

Marcelo Cantos
There's a project by the Dukes of Erl called nodefinder that allows for automatic discovery. It's pretty cool.
mwt
@mwt: Why not make it an answer? I'd vote for it! :-)
Marcelo Cantos
A: 

Call it [email protected]. I did this on EC2 and had an erlang cluster I could spin up at an arbitrary size directly from the AWS console.

Dustin