1
votes

I have an erlang application which I will need to run in distributed way.

Now to form a cluster, erlang nodes need to share the same cookie value and to get connected either of the below approach could be taken -

net_adm:ping/1

net_kernel:connect_node/1

but doing this way I will need to maintain the node list and also handle the failover in custom way. Even in case of failover how to know the which node to connect to, as the starting nodelist could have been changed till then.

So can anyone suggest how to form a erlang cluster with minimum effort and future nodes can join the cluster automatically without giving the actual nodeList.

1

1 Answers

2
votes

There are not many 100% fool-proof solutions for this. Many of us have implemented our own solutions every now and then. I did this, at least, 3 times in my life.

2 of them, I used an external database (Redis once, MySQL once) where I registered and unregistered current living nodes.

The other opportunity, I used net_adm:world() and .erlang.hosts. Take a look at the docs for that.

I’m also aware of some projects working on a generalization of this kind of tool: I think Erlang Solutions was working in one, and I’m not sure if LASP or Partisan or something other tool by Chris Meiklejohn. You should check those out.