[ejabberd] about ejabber cluster setup

Tom Wang tomwang99 at gmail.com
Sat Mar 12 01:22:37 MSK 2005


Hi, 

I am newbie. 
I am installing a ejabber cluster in my network(mynet.com). ejabber servers are ej.mynet.com and ej1.mynet.com. their OS is freebsd5.3.

the 2 ejabber server already runing using same hostname "mynet.com". I can register using name at mynet.com and login to ej.mynet.com. but I can't login to ej1.mynet.com using same JID. and If I login to ej1.mynet.com using anothername at mynet.comI , I can't talk with name at mynet.com in the first server. I think the problem should be the database doesn't synchronize.
I don't know mnesia, the following are some display when I did as "How to setup ejabberd cluster" in install guide.

1. copy cookie to same directory(/var/run/ejabberd/) from ej.mynet.com to ej1.mynet.com. 
2. on ej1.mynet.com: /var/spool/ejabber, run
erl -sname ejabberd -mnesia extra_db_nodes "['ejabberd at ef']" -s mnesia
then, run "mnesia:info(). "
----------------------------------
(ejabberd at ej1)1> mnesia:info().
---> Processes holding locks <--- 
---> Processes waiting for locks <--- 
---> Participant transactions <--- 
---> Coordinator transactions <---
---> Uncertain transactions <--- 
---> Active tables <--- 
schema         : with 1        records occupying 386      words of mem
===> System info in version "4.2.1", debug level = none <===
opt_disc. Directory "/var/spool/ejabberd/Mnesia.ejabberd at ej1" is NOT used.
use fallback at restart = false
running db nodes   = [ejabberd at ej1]
stopped db nodes   = [ejabberd at ef] 
master node tables = []
remote             = []
ram_copies         = [schema]
disc_copies        = []
disc_only_copies   = []
[{ejabberd at ej1,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
(ejabberd at ej1)2> 
-----------------------------
there is n't "running db nodes   = [ejabberd at ef, ejabberd at ef1]" as install guide said.

3. run " mnesia:change_table_copy_type(schema, node(), disc_copies). "
show "{atomic,ok} "

4. run " mnesia:info().", show
------------------------------------------------
---> Processes holding locks <--- 
---> Processes waiting for locks <--- 
---> Participant transactions <--- 
---> Coordinator transactions <---
---> Uncertain transactions <--- 
---> Active tables <--- 
schema         : with 1        records occupying 395      words of mem
===> System info in version "4.2.1", debug level = none <===
opt_disc. Directory "/var/spool/ejabberd/Mnesia.ejabberd at ej1" is used.
use fallback at restart = false
running db nodes   = [ejabberd at ej1]
stopped db nodes   = [ejabberd at ef] 
master node tables = []
remote             = []
ram_copies         = []
disc_copies        = [schema]
disc_only_copies   = []
[{ejabberd at ej1,disc_copies}] = [schema]
3 transactions committed, 0 aborted, 0 restarted, 1 logged to disc
0 held locks, 0 in queue; 0 local transactions, 0 remote
0 transactions waits for other nodes: []
ok
(ejabberd at ej1)4> 
----------------------------------------
5. run "q().", exit.
ej1# ls -R , it create a directory "Mnesia.ejabberd at ej1" in /var/spool/ejabberd/
-------------------------------
Mnesia.ejabberd at ej1

./Mnesia.ejabberd at ej1:
DECISION_TAB.LOG        LATEST.LOG              schema.DAT
ej1# 
--------------------------------------

6. run ejabberd, use script in freebsd, the ejabberd.cfg is as same as ej.mynet.com(the first server)
"/usr/local/etc/rc.d/ejabber.sh start ", it will create some files in /var/spools/ejabberd 
-------------------------
ej1# pwd
/var/spool/ejabberd
ej1# ls
LATEST.LOG              local_config.DCD        passwd.DCD              schema.DAT
Mnesia.ejabberd at ej1     motd.DCD                privacy.DCD             vcard.DAT
acl.DCD                 motd_users.DCD          private_storage.DAT     vcard_search.DCD
config.DCD              muc_registered.DCD      pubsub_node.DAT
irc_custom.DCD          muc_room.DCD            pubsub_node_3.DAT
last_activity.DCD       offline_msg.DAT         roster.DCD
ej1# 
---------------------------------

do you know what is the problem ?  How I can make the cluster work? 
Thanks in advance
Tom

the following is ejabberd running script in freebsd.
--------------------------
ej1# cat /usr/local/bin/ejabberd
#!/bin/sh

[ -r /var/run/ejabberd/.erlang.cookie ] && HOME=/var/run/ejabberd
[ -f /usr/local/etc/ejabberd.defaults ] && .  /usr/local/etc/ejabberd.defaults

CONFIG=/usr/local/etc/ejabberd.cfg
LOG=/var/log/ejabberd/ejabberd.log
SASL_LOG=/var/log/ejabberd/sasl.log
SPOOL=/var/spool/ejabberd

ARGS=

while [ $# -ne 0 ]
do
    PARAM=$1
    shift
    case $PARAM in
        --) break ;;
        --config) CONFIG=$1 ; shift ;;
        --log) LOG=$1 ; shift ;;
        --sasl-log) SASL_LOG=$1 ; shift ;;
        --spool) SPOOL=$1 ; shift ;;
        *) ARGS="$ARGS $PARAM" ;;
    esac
done

exec erl -sname ejabberd \
    -s ejabberd \
    -ejabberd config \"$CONFIG\" log_path \"$LOG\" \
    -sasl sasl_error_logger \{file,\"$SASL_LOG\"\} \
    -mnesia dir \"$SPOOL\" \
    $ERL_OPTIONS $ARGS "$@"

ej1# 
-----------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jabber.ru/pipermail/ejabberd/attachments/20050311/b40203ce/attachment-0001.html


More information about the ejabberd mailing list