Prepare the Erlang cookie so that all machines in the cluster share the same one:

1
2
echo magic > ~/.erlang.cookie
chmod 400 ~/.erlang.cookie

Bring up a machine using erl -name <name>. In this step, I got an error (on my ubuntu box), which is probably attributed to the fact that my machine doesn’t have a Fully Qualified Domain Name (FQDN). Therefore, I used <name>@ip to work around this problem.

In order to construct the cluster, we need to send an initial message between machines to set up the connection, and one easy way is to send a ping message.

1
2
net_adm:ping(albert@myip).
nodes(). % shows all connected nodes