[ejabberd] How do I add an ejabberd node to a cluster?

Inoshiro Linden inoshiro at lindenlab.com
Sat Mar 5 01:53:28 MSK 2011


Hello,

My goal is to start an ejabberd node and have it join an existing
cluster.  How do I do this?

My current approach is to start delete the mnesia database, start the
new node (ejabberdctl start) then run a script which ends up doing
this:

update_cluster_hosts(Node, Hosts) ->
    io:format("Updating node ~p cluster hosts lists to ~p.~n", [Node, Hosts]),
        ok = rpc:call(Node, application, stop, [ejabberd]),
        ok = rpc:call(Node, application, stop, [mnesia]),
        ok = rpc:call(Node, mnesia, delete_schema, [[Node]]),
        ok = rpc:call(Node, application, start, [mnesia]),
        {ok, _} = rpc:call(Node, mnesia, change_config,
[extra_db_nodes, Hosts]),
        ok = rpc:call(Node, application, start, [ejabberd]),
        rpc:call(Node, mnesia, info, []),
        ok.


This leads to the nodes having strange inconsistency problems.  Here
are some examples from the logs are below.  Can anyone recommend the
best approach to accomplish this goal?

Regards,
Nathan Wilcox


ps: Log snippets:


--- From host0 ejabberd.log ---
=ERROR REPORT==== 2011-03-04 22:44:52 ===
** Node 'ejabberd at host2' not responding **
** Removing (timedout) connection **

=ERROR REPORT==== 2011-03-04 22:44:52 ===
** Node 'ejabberd at host2' not responding **
** Removing (timedout) connection **


--- From host1 ejabberd.log ---
=ERROR REPORT==== 2011-03-04 22:16:34 ===
Mnesia('ejabberd at host1'): ** ERROR ** mnesia_event got
{inconsistent_database, running_partitioned_network, 'ejabberd at host0'}

=ERROR REPORT==== 2011-03-04 22:44:54 ===
** Node 'ejabberd at host0' not responding **
** Removing (timedout) connection **


--- From host2 ejabberd.log ---
=ERROR REPORT==== 2011-03-04 22:16:37 ===
Mnesia('ejabberd at host2'): ** ERROR ** mnesia_event got
{inconsistent_database, running_partitioned_network, 'ejabberd at host0'}


More information about the ejabberd mailing list