[ejabberd] Clustering with ejabberd 2.0.2_2 - please clarify something about it's use

Tom tom.valdes at gmail.com
Thu Oct 2 02:13:33 MSD 2008

thanks for your explanation...

So if I have my 2 servers pointing to the same mySQL database, what is 
the point of getting the ejabberd clustering working?
In a test setup I created, I had this and I was able to login directly 
to testim as well as testim02 using the same id.

1:  I logged into testim and created testuser
2:  I then logged off and logged on to testim02 with testuser at testim02  
(the same testuer created in step 1)

checking the ejabberd table in mySQL on testim, I confirmed that no 
matter which IM server I logged into, the id was getting created on testim.

Since this allows me to have a single and consistent database for both 
IM servers and ejabberd doesn't handle any kind of seemless reconnection 
if a server fails, then why would I need or want to cluster within ejabberd?


Stephan Maihöfer wrote:
> hi,
> you seem to mix up a few things here, let me clarify:
>> Am I supposed to have my client reconnect to TESTIM02 or is ejabberd 
>> supposed to automatically redirect me?
> no, neither. ejabberd does not do load-balancing or fail-safe-redirection
> or whatever you want for you. your easiest choice would be to
> set up round-robin DNS for your domain that serves the ip-adresses
> of both your cluster nodes. a better choice would be to
> set up some kind of load-balancer that redirects only to nodes
> that are up...but that really is a lot more of a hassle.
> so, once "testim" goes down, all the users on that node will be
> disconnected and noone can connect there until the host is
> up gain...
>> If I try connecting to TESTIM02 with my TESTIM id, it tells me I'm 
>> unauthorized which makes sense since my id was created as 
>> testuser at TESTIM  and not testuser at TESTIM02.
> this sounds very much as if you are messing up nodes and vhosts.
> there is ONE domain served by a ejabberd-cluster (can be more, but
> we will take the easy route). your username (jid) on whatever node
> in the cluster will be something like user at example.com, regardless of
> where you connect. you have to set the hosts option in ALL the
> nodes in the cluster to that domain (example.com). THIS is the DOMAIN
> that your ejabberd cluster serves.
> now you can (and in a cluster will) have different servers that
> serve this domain. each of these will have a hostname of it's own.
> this makes it three hostnames, for example:
>   node1.example.com ->
>   node2.example.com ->
> now a user user at example.com can connect to both these hosts
> (you will have to explicitly state which one in your jabber
> client to prevent it from connecting to the host behind the @ in your jid).
> now you can set up round-robin dns to alternatingly server
> these two ip-adresses for you domainname:
>   example.com ->
>   example.com ->
> so, SOME of you users will be connected to node1., the others
> to node2.
> once node1 goes down and the client does a new DNS lookup
> of the domain, it MAY get the other IP and connect there,
> making the reconnecting look as if the original host is
> up again.
> notice how none of that is ejabberds work, but mostly cleint
> and dns stuff...
> i hope this clears stuff up a bit.
> greets,
> stephan
> ------------------------------------------------------------------------
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd

More information about the ejabberd mailing list