trouble clustering with ejabberd 2.0.2_2 and mySQL

I have 2 ejabberd machines set up (testim and testim02). Each server points to its own mySQL database and I can connect to each one without issue. (when not clustered)

The trouble comes when I attempt to cluster them.
If I start the first server (testim) with the following command:
./erl -sname ejabberd -mnesia extra_db_nodes "['ejabberd@testim02']" -s mnesia -ejabberd config "/opt/ejabberd-2.0.2_2/conf/ejabberd.cfg"

and the second server (testim02) with the following:
./erl -sname ejabberd -mnesia extra_db_nodes "['ejabberd@testim']" -s mnesia -ejabberd config "/opt/ejabberd-2.0.2_2/conf/ejabberd.cfg"

I get successful pongs:

(ejabberd@testim)1> net_adm:ping('ejabberd@testim02').
pong

(ejabberd@testim02)6> net_adm:ping('ejabberd@testim').
pong

But I am not able to login to either one using my jabber client.

thanks,
tom

btw: this is on Linux (if it matters)

Don't worry about client login until finished step 6

What you describe is step 2 as explained in the ejabberd Guide "6.2 Clustering Setup".

You will only fully start ejabberd (for normal operation) in step 6.

getting closer? but still stuck.

badlop wrote:

What you describe is step 2 as explained in the ejabberd Guide "6.2 Clustering Setup".

You will only fully start ejabberd (for normal operation) in step 6.

Stephan pointed me to this blog
http://dev.esl.eu/blog/2008/09/30/set-up-clustering-in-ejabberd/
and now I'm at the point where I can create accounts and login to testim02

I went back to using mnesia to at least get clustering working.
I set passwd and pubsub_item to "RAM and disc copy" in the database setup so now the stats section on the admin page of both testim and testim02 both are showing the correct number of registered users.

With my jabber client, I can connect to testim02, but I can't connect to testim (my jabber client reports "Host Unknown" but I can ping testim from a command prompt)

When I pull the plug on testim02, I lose the connection and testim doesn't continue my session.. it seems related to the inability to connect to testim, but at this point I'm just guessing.

If I restart ejabberd on testim02, I am able to connect to both testim and testim02 for about a minute or 2 then my connections on testim get dropped and my client says "Host Unknown".. testim02 continues to work fine.

thanks,
tom

ps..if anyone is available and willing to help over an IM session during 10am and 6pm EST, I would greatly appreciate it.

Problem in hostname

surge wrote:

With my jabber client, I can connect to testim02, but I can't connect to testim (my jabber client reports "Host Unknown" but I can ping testim from a command prompt)

I imagine in your Jabber client for testim02 you define "Jabber server: jabber.example.org" and "Host to connect to: testim02".
And for testim you define "Jabber server: jabber.example.org" and "Host to connect to: testim".

The ejabberd.cfg in both nodes must contain the same line:

{hosts, ["jabber.example.org"]}.
surge wrote:

When I pull the plug on testim02, I lose the connection and testim doesn't continue my session.. it seems related to the inability to connect to testim, but at this point I'm just guessing.

Note that ejabberd clustering does not migrate running sessions to another node when one is stopping.
ejabberd clustering allows to share account data in all the nodes, but the connections are established by the client to one node.
When the node stops or crashes, the client will be disconnected and has to reconnect (probably to another node in the cluster).

surge wrote:

If I restart ejabberd on testim02, I am able to connect to both testim and testim02 for about a minute or 2 then my connections on testim get dropped and my client says "Host Unknown".. testim02 continues to work fine.

Ah, this is strange. Then you have the 'hosts' option correctly set in both ejabberd.cfg as I explained before?

Syndicate content