[ejabberd] need help on ejabberd's implementation of clustering

MOHSIN mohsin3000 at hotmail.com
Mon Jan 31 13:39:50 MSK 2011

Xi Liu <jason.liuxi <at> gmail.com> writes:

> Hi badlopThank you very much for your reply.According to my understanding can 
I describe the clustered ejabberd working picture like this?
> Use cicso slb or whatever any other load balance facilities to distribute the 
users and average the load. From the user side, he only knows he was connected 
to something like test.org, but actually he was distributed to the machine which is one of  the test.org's  cluster's node. and when two 
friends connected to different nodes of one xmpp server. Their chat will act 
like this: client1 <at> test.org sended a message to client2 <at> test.org. the 
node client1 connected to try to find which node client2 was connected to and 
tell the corresponding process to forward the message to client2 . And the whole 
procedure was based on mnesia's cluster. Is this right?
> --------------------------------------------------
> And there is another question.about the guide. According to the guide ejabberd 
got one service load balancing mechnism.(http://www.process-
> ejabberd includes an algorithm to load balance the components that are plugged 
on an ejabberd cluster. It means that you can plug one or several instances of 
the same component on each ejabberd cluster and that the traffic will be 
automatically distributed.
> The default distribution algorithm try to deliver to a local instance of a 
component. If several local instances are available, one instance is chosen 
randomly. If no instance is available locally, one instance is chosen randomly 
among the remote component instances.
> --------------------------------------------------
> what is this slb aiming at? and what is a componet?Is it a  module such as 
mod_muc ?
> and yet another question, Is muc service also distibuted to nodes? I mean the 
way muc rooms distributed is random?
> Sorry for so many stupid questions and Thanks in advance!
> 2010/3/12 Badlop <badlop <at> gmail.com>
> 2010/3/10 Xi Liu <jason.liuxi <at> gmail.com>:
> > And I will appreciate very much if some body could give me a
> > brief introduction on the clustering mechanism.
> You setup Mnesia in a way that the ejabberd nodes share the content of
> some tables.
> Tell clients to connect to different nodes, depending on your needs
> (server load, round-robin, ...). ejabberd doesn't decide to spread
> users or . Users themselves connect to a specific node.
> Related tutorial:
> # Clustering ejabberd nodes using mnesia 
> > From the ejabberd
> > installation and operation guide I infer that the cluster mechanism is base
> > on mnesia.
> > where the code is located concering clustering mechanism?
> ejabberd clustering relies on mnesia clustering.
> In fact, I think there isn't specific code in ejabberd itself for that.
> You will notice that the ejabberd Guide section about clustering ejabberd
> involves only setting Mnesia clustering.
> > I got some questions about the implementation of ejabberd clustering.I
> > googled and found nothing really useful about this topic.
> > I read some of the ejabberd source code including start up process
> > ,ejabberd_odbc concering about mysql, and the muc module. I found almost
> > nothing about clustering such as load balance mechanism.
> ejabberd doesn't implement load balancing for client connections.
> That's a task you can do at your will, on the DNS side...
> For example, see:
>   Configuring fault-tolerant XMPP enviroment using Cisco SLB 
> > Is it using mnesia as storage a prerequisite deloying cluster ejabberd 
> You can store some information (auth, the rosters, vcards, offline
> messages and private XML storage) in a MySQL database, and configure
> all your ejabberd nodes to use that database.
> And for the other tables that you want to be clustered, setup them in
> Mnesia for clustering.
> ---Badlop
> ProcessOne
> _______________________________________________
> ejabberd mailing listejabberd <at> 
> _______________________________________________
> ejabberd mailing list
> ejabberd <at> jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
hey i was facing around the same problems luckily this simple tutorial helped me 
out hope it helps you also 


More information about the ejabberd mailing list