Hi,
I'm currently trying to figure out on how to configure my 2 ejabberd nodes to do clustering.
Basic configuration is as follows:
- The two nodes are on different servers.
- They should both serve the domain "chat.example.com"
- Node one is "chat1", node two is "chat2"
- The goal is to do load balancing between the two nodes (we have an external load balancer for that)
What I've done until now:
- I disabled S2S Listening on Port 5269 - Is it correct that S2S is needed for federation but not for clustering?
- Copied .erlang.cookie from chat1 to chat2
- In /etc/ejabberd/ejabberd.cfg I've got the following set as hosts:
{hosts, ["chat.example.com"]}.
- On chat2 I stopped ejabberd and ran the command specified in the clustering documentation:
erl -sname ejabberd -mnesia dir '"/var/lib/ejabberd/"' -mnesia extra_db_nodes "['ejabberd@chat1']" -s mnesia
- When I run "mnesia:info()." I get amongst other things the following output:
running db nodes = [ejabberd@chat2]
stopped db nodes = [ejabberd@chat1]
As far as I read, this isn't the correct behaviour, both nodes should be in the running db nodes part.
Now my question is: why doesn't it work? :)
The .erlang.cookie is exactly the same.
- Is it because I didn't change the ERLANG_NODE in the ejabberdctl script (it's still set to "ejabberd")?
- Is it because I first need to do something on chat1 too? (I didn't do anything there yet because chat1 is the currently "live" node, can't I "gracefully upgrade" to clustering?)
Thanks for helping me. If you need additional informations, please ask :)
Michael
Connecting two ejabberd nodes
Connecting two ejabberd nodes to be a cluster is like connecting two erlang nodes to be a cluster. So, you can experiment first with this tutorial: http://www.ejabberd.im/interconnect-erl-nodes
Oh, didn't see that yet!
Oh, didn't see that yet! Thanks