[erlang-questions] Distributed Application where its only running if all required Nodes are present

Peer Stritzinger peerst@REDACTED
Sat Oct 25 17:18:20 CEST 2014


Hi,

I want to run a application on several nodes at the same time.  However 
it only should run on any node if all nodes are present and can 
communicate.

If the node set is not complete, the application should be stopped.

If the node set afterwards is complete again it should be restarted.

Is a behaviour like this doable with OTPs build in distributed applications?

E.g. would something along these lines do what I'm intending?

On node 1:

[{kernel,
  [{distributed, [{myapp, 5000, [node1]}]},
   {sync_nodes_mandatory, [node2, node3]},
   {sync_nodes_timeout, 30000}
  ]}]

On node 2:

[{kernel,
  [{distributed, [{myapp, 5000, [node2]}]},
   {sync_nodes_mandatory, [node1, node3]},
   {sync_nodes_timeout, 30000}
  ]}]

On node 3:

[{kernel,
  [{distributed, [{myapp, 5000, [node3]}]},
   {sync_nodes_mandatory, [node1, node2]},
   {sync_nodes_timeout, 30000}
  ]}]

Cheers,
-- Peer





More information about the erlang-questions mailing list