Ejabberd Clustering on Amazon EC2 servers

Hello all,

I am trying to setup a cluster of Ejabberd servers on Amazon cloud. I have successfully setup cluster in my local network on windows systems, but failing to do the same with EC2 servers running on ubuntu OS.

Here is what I have done -

1. I have setup two ec2 servers (launched from my private ubuntu AMI with ejabberd installed ) running independently with 'hostname -s'. I could not run the servers with full hostname by just setting ERLANG_NODE=ejabberd@`hostname -f` in ejabberdctl.cfg. (Should I change anything else to make it work with full name?)

So, I have set ERLANG_NODE=ejabberd@`hostname -s` and they are running fine without any problem.
And I see both servers can connect to each other with just shortname (I tried telnet-ing the other server on port 5268 and it worked fine. So, assuming that they are able to connect to one another with just short hostname).

I have also set FIREWALL_WINDOW=4000-4010 in /etc/default/ejabberd and enabled these ports from ec2 security group.

I have started the servers on both the nodes by executing the command sudo /etc/init.d/ejabberd start

2. Both nodes have same /etc/ejabberd/ejabberd.cfg - configured to serve the same domain and use the same MySQL DB server.

I executed this on both the nodes to check if they have same erlang cookie.

sudo ejabberdctl debug
erlang:get_cookie().

(As these instances are created from the same AMI, I didn't need to manually copy the cookie from one node to the other)

3. I stopped the ejabberd server on Node 2 by executing the command
sudo ejabberdctl stop

4. Executed the clustering command on Node 2
ubuntu@domU-22-22-22-22-BB-22:~$ erl -sname ejabberd@domU-22-22-22-22-BB-22 -mnesia extra_db_nodes "['ejabberd@domU-11-11-11-11-11-11']" -s mnesia

and entered the command mnesia:info(). The output is

Erlang R13B03 (erts-5.7.4) [source] [64-bit] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.4 (abort with ^G)
(ejabberd@domU-22-22-22-22-BB-22)1> mnesia:info().
---> Processes holding locks <---
---> Processes waiting for locks <---
---> Participant transactions <---
---> Coordinator transactions <---
---> Uncertain transactions <---
---> Active tables <---
schema : with 1 records occupying 392 words of mem
===> System info in version "4.4.12", debug level = none <===
opt_disc. Directory "/home/ubuntu/Mnesia.ejabberd@domU-22-22-22-22-BB-22" is NOT used.
use fallback at restart = false
running db nodes = ['ejabberd@domU-22-22-22-22-BB-22']
stopped db nodes = ['ejabberd@domU-11-11-11-11-11-11']
master node tables = []
remote = []
ram_copies = [schema]
disc_copies = []
disc_only_copies = []
[{'ejabberd@domU-22-22-22-22-BB-22',ram_copies}] = [schema]
2 transactions committed, 0 aborted, 0 restarted, 0 logged to disc
0 held locks, 0 in queue; 0 local transactions, 0 remote
0 transactions waits for other nodes: []
ok

.
.
.

Can somebody throw some pointers to debug what the issue could be or point anything I am missing.

Thanks a ton in advance.
- Prasad.

Hi Prasad, I'm facing similar

Hi Prasad,
I'm facing similar issues on EC2. Did you manage to solve the issue?

Regards
Krishnan.

Syndicate content