Set up clustering in ejabberd
ESL Developer Blog - - September 30, 2008I found clustering in ejabberd not so easy if you go strictly by the manual
It does not really mention that Mnesia likes to create databases in the present working directory, and name them prefixed with Mnesia. This makes it hard to find out why two ejabberd nodes won’t connect to each others. Here is what we do:
- Configure and start ejabberd on “first”:
- Edit ejabberdctl.cfg to have your FULL nodename in the last line (ejabberd@first.example.com)
- Edit sbin/ejabberdctl to have the right nodename in NODE and HOST (lines 11 and 12)
- Edit sbin/ejabberdctl to have $ERLANG_NODE at the end
- sbin/ejabberdctl start
Configure and start ejabberd on “second”:
- Edit ejabberdctl.cfg to have your FULL nodename in the last line (ejabberd@second.example.com)
- Edit sbin/ejabberdctl to have the right nodename in NODE and HOST (lines 11 and 12)
- Edit sbin/ejabberdctl to have $ERLANG_NODE at the end
- sbin/ejabberdctl start
- Stop ejabberd on “second”.
- Go to the database directory on “second” (i.e. /var/lib/ejabberd/db/)
- Delete or move away the directory that is named after your node (”ejabberd@second.example.com”)
Start your remote erlang shell on “second”
erl -name ejabberd@second.example.com -mnesia extra_db_nodes “[‘ejabberd@first.example.com’]” -s mnesia
(You should now see this node in the list of nodes in the web admin on “first.example.com”, not quite usable though. This tells you that the Mnesia connection itself is running fine.)Syncronise databases
mnesia:change_table_copy_type(schema, node(), disc_copies).
Quit Mnesia
q().
Move the newly created directory (Mnesia.ejabberd@second.example.com) to the location of the directory that you deleted/moved before.
mv Mnesia.ejabberd@second.example.com ejabberd@second.example.com
Start ejabberd on “second” (sbin/ejabberdctl start)
You should now see both nodes in the web admin interface at http://first.example.com:5280/admin and the cluster should be up and running fine. Now you can set up the rest of the database replication through the web interface. Works fine for us…
Categories: Blogs ESL Developer Blog
Comments
No comments so far, you could be the first.Add comment
Erlang on Twitter
» quercialwji2 (Quercia Quinn): @RolArens http://t.co/pPiIpTCx
» quercialwji2 (Quercia Quinn): @kreese555 http://t.co/pPiIpTCx
» erlang (Andreas Åkre Solberg): RT @SaraJChipps: Node.js is like taking a bubble bath in JavaScript.
» trabajosit (Empleos en IT): argentina Desarrolladores - iOS, Ruby, Erlang: Estamos buscando un líder de desarrollo que quiera hacer una gran… http://t.co/zhTLpGI1
» erlang (Andreas Åkre Solberg): jQuery Scroll Path Plugin http://t.co/DHZ0W36c via @JoelBesada
» martyns (martynas): fighting with load bursts. probably its time to deploy https://t.co/xJxKcRmQ. #erlang
» Louellaoqk (Louella Delaroca): Informationsmanagement in Hochschulen (German Edition): Die Informations- und Kommunikationstechnik (IuK) erlang… http://t.co/95UJGZS3
» fgtrjhyu (アスパラガー): 多分「どうでもいい」だと思うんだ。 Smalltalk→Obj…C erlang→node.jsと同じで。
» zbyszek (Zbyszek Żółkiewski): RT @michalptaszek: Going to give #ejabberd tutorial on @erlangfactory in SF this March :) Anyone?
http://t.co/0bnFtIKf #xmpp #erlang
» jeedee (jeedee): Erlang, y u so fast?
Statistics
Number of aggregated posts: 10456
Number of comments: 1445
Most recent article: February 06, 2012
Latest comments
» simple smile on Scale means Skills: Very informative article. Pretty sure people would love to go to that place for shopping. Specially to those who are…
» simplesmile on 27 January 2012: Erlang Solutions embarks on an Erlang Embedded KTP: Your article will make the world better. Thanks again and good luck to you in your life. See you next time.simplesmile
» tandblekning easewhite on 08 February 2012: Erlang Express 3-day Course in San Francisco on 8 February: ncomprehensible to me now, but in general, the usefulness and significance is overwhelmingtandblekning easewhite