4
votes

I want to cluster ejabberd node, so I want each node to have a different node name. I searched over net, everywhere it says you can change nodename in ejabberdctl.cfg file by changing ERLANG_NODE=ejabberd@desired_name.

But the moment I modify that line to any other name, when starting the server, it says "Crash dump written to......", and when stopping the server using ejabberdctl stop, it says "Failed RPC connection to the node ejabberd@desired_name: nodedown".

Can somebody tell me how to change the node name successfully?

Thanks in advance!!!

4
You may have a problem with mnesia. I don't remember the details but mnesia tables stays locked into the localhost of the node. If you don't need to recover the data on mnesia, simply delete the db dir and restart ejabberd serverNuno Freitas

4 Answers

3
votes

Whatever hostname you add to the Ejabberd node, you will have to reflect it in the hosts file (/etc/hosts), as ejabberd tries to resolve the domain name you add, if it is not resolvable, it will fail .. it should be that simple and nothing more.

1
votes

Although its a bit too late, but for those who get the same problem, Here is what you must do:

  1. Search for all running processes of ejabberd and kill them.

    ps aux | grep ejabberd

    kill process_id_of_daemon

  2. Kill all processes pertaining to epmd which is a daemon run by erlang runtime.

    ps aux | grep epmd

    kill process_id_of_daemon

  3. Restart ejabberd

The problem here is that if you also have erlang installed in your system, the daemon epmd is still running and ejabberd takes this as a duplicate instance trying to be invoked.(Hence the duplicate name error in the crash log)

Stopping these processes and then running ejabberd would make epmd run again so it doesnt affect erlang either.

1
votes

Just for the records. You can use the option provided by ejabberdctl. All you have to do is ...

  1. start server with old node name
  2. take a backup of mnesia db
  3. stop server and move all mnesia files from /var/lib/ejabberd
  4. start server with new node name
  5. change node name in mnesia backup with
    ejabberdctl mnesia_change_nodename $OLDNODE $NEWNODE $OLDFILE $NEWFILE
  6. set new file as a fallback
    ejabberdctl install_fallback $NEWFILE
  7. stop the server and stop again

The entire process is explained in ejabberd docs

1
votes

The front part of ERLANG_NODE should be your name. The after '@' part is domain/host.

ERLANG_NODE=your-name@host

Cleanup mnesia dir on new nodes (they do not hold any relevant info since you have never clustered)