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?
a source to share
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.
a source to share