Erlang: What's a good way to automatically assign node names?

I want to have an EC2 based cluster that can grow and shrink as I please. No node will be special and I don't want them to coordinate their names with any other nodes. I don't want to hardcode the names as I want to use one image and expand them as needed. I understand that nodes must have names to communicate. What's a good strategy for automatically and dynamically generating a name when the script runs in time?

+2


a source to share


2 answers


Use the uuidgen

API or equivalent if the shell scripting language is not (ba)sh

. If you don't want to see single quotes around node names, 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 a node to be discoverable, get the init code to publish the node to some kind of node directory service.

+1


a source


Name it node @ my.ip.add.ress. I did this on EC2 and had an erlang cluster that I could deploy at an arbitrary level directly from the AWS console.



+1


a source







All Articles