[ejabberd] Node Clustering issue

Florian Jensen admin at flosoft.biz
Wed Jun 11 20:26:30 MSD 2008


Matthew Reilly wrote:
> Florian Jensen wrote:
>> Hi,
>> I have been trying to get a cluster working for the last few hours,
>> without any luck.
>> I am running: jabber at ds2581:~/ejabberd-2.0.1$ erl -sname ejabberd
>> -mnesia extra_db_nodes "['ds2248.flosoft-servers.net']" -s mnesia
>> Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] [async-threads:0]
>> [kernel-poll:false]
> I see two issues with your command:
> The extra_db_nodes needs to be in the format<name>@<node>
> Where:
> 1)<name>  is what is passed to the -sname (or -name) argument of the
> node you're clustering with.
> 2) If the main node was started with -sname,<node>  is just the first
> part of the host name. If it was started with -name,it would be the full
> part of the hostname.
> e.g.
> If your main node was started with "erl -sname ejabberd ..." on the host
> ds2248.flosoft-servers.net, use:
> -mnesia extra_db_nodes "['ejabberd at ds2248']"
> If your main node was started with "erl -name ejabberd ..." on the host
> ds2248.flosoft-servers.net, use:
> -mnesia extra_db_nodes "['ejabberd at ds2248.flosoft-servers.net']"
I launched the server via ./start in /bin/ . I used the install for 
ejabberd 2.0.1 for AMD64.

> Two other possible gotchas:
> 3) Make sure that the .erlang.cookie in the ejabberd user's home
> directory on the second machine is the same as on the system you're
> trying to cluster with. (Note: the .erlang.cookie file generally does
> *not* have a newline at the end, so if you just open the file in an
> editor, copy the text from the first server, and save, the editor will
> add a newline -- causing clustering to fail). This is true for
> UNIX/Linux type systems. I don't know where the erlang cookie is stored
> on Windows types systems.
The .erlang.cookie is in /home/jabber/, so that should be fine.

> 4) clustering is not IP transparent. i.e. if example1.net and
> example2.net both resolve to, they still aren't equivalent:
> ejabberd at example1.net and ejabberd at example2.net are not equivalent. The
> name you use needs to be the same one you get with the "hostname"
> command on the main server. (Again, that's true for UNIX/Linux. I'm not
> sure about Windows)
> To see what node name is being use on the server you're trying to
> cluster with, run this command on the main server:
> erl -sname test -eval 'io:format("~nMy node: ~p~n",[node()]), halt().'
> (If the main ejabberd was started with -name, replace -sname with -name
> in the above command)

I use their real hostnames. Also the nodes are started with their full 
hostname. The machine hostname matches this. They can also resolve 

>> {"init terminating in
>> do_boot",{undef,[{mnesia,start,[]},{init,start_it,1},{init,start_em,1}]}}
>> Crash dump was written to: erl_crash.dump
>> init terminating in do_boot ()
>> jabber at ds2581:~/ejabberd-2.0.1$
>> But this fails. The cookies are correct. I have been following the
>> official documentation:
>> http://www.process-one.net/docs/ejabberd/guide_en.html#htoc71
>> Any help would be appreciated.
>> Greets,
>> Florian Jensen

What would the command look like?


Florian Jensen

More information about the ejabberd mailing list