[erlang-questions] Forming a cluster
Rick Pettit
rpettit@REDACTED
Wed Oct 24 17:12:40 CEST 2007
On Wed, Oct 24, 2007 at 09:48:09AM -0400, Jack Orenstein wrote:
> What is the recommended procedure for setting up a cluster of nodes,
> each running an Erlang VM (all with the same .erlang.cookie)? The
> nodes are all in the same subnet, behind a firewall. The node
> population is reasonably static, but nodes there may be occasional
> additions. When a node joins, the nodes already in the cluster need
> to know about it. Each node has to know about every other node, (e.g.
> by calling nodes()).
>
> net_kernel:monitor_nodes will indicate when a node joins, but only if
> the new node sends a message to some node in the cluster. How does
> the new node know who is present? There seems to be a bootstrapping
> problem. Also, requiring a new node to know about a cluster member is
> problematic since the selected node might be down.
>
> net_adm and the .erlang.hosts file is a possible solution, but that
> seems static. It doesn't seem to accomodate nodes joining after the
> initial cluster forms.
>
> Is there a dynamic solution that doesn't require the new node to know
> anything about the existing cluster members?
Most systems I've worked on involved a shared set of mnesia database nodes
containing configuration information for the entire cluster.
All other nodes in the cluster are started with -mnesia extra_db_nodes [...],
and thus no explicit net_adm:ping/1 is required (in my code).
Of course this is just another form of static configuration...
To do what you want you may need to take a close look at how epmd(1) works.
-Rick
More information about the erlang-questions
mailing list