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

Stephan Maihöfer sma at turtle-entertainment.de
Thu Oct 2 14:18:30 MSD 2008


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.


More information about the ejabberd mailing list