5

I currently have an ejabberd server running at domain A. It has a bunch of users with accounts like xyz@A. I want to setup alternative servers so that if A is down, clients can transparently use alternative servers B and C (thus, while still using their xyz@A account).

The DNS part I think is pretty simple, I need to edit A zone file to add SRV records of the alternative servers like in this example (http://wiki.xmpp.org/web/SRV_Records#Example_3):

_xmpp-client._tcp.example.net. 86400 IN SRV 5 50 5222 server1.example.net.
_xmpp-client._tcp.example.net. 86400 IN SRV 10 30 5222 server2.example.net.
_xmpp-client._tcp.example.net. 86400 IN SRV 10 10 5222 server3.example.net.
_xmpp-client._tcp.example.net. 86400 IN SRV 10 10 5222 server4.example.net.
_xmpp-client._tcp.example.net. 86400 IN SRV 15 0 5222 backup.example.net.
_xmpp-server._tcp.example.net. 86400 IN SRV 5 50 5269 server1.example.net.
_xmpp-server._tcp.example.net. 86400 IN SRV 10 30 5269 server2.example.net.
_xmpp-server._tcp.example.net. 86400 IN SRV 10 10 5269 server3.example.net.
_xmpp-server._tcp.example.net. 86400 IN SRV 10 10 5269 server4.example.net.
_xmpp-server._tcp.example.net. 86400 IN SRV 15 0 5269 backup.example.net.

What are the steps and specific configuration to setup the ejabberd servers on host B and C w.r.t authentification and chatrooms?

Although working redundant servers with the initial user db of A will be enough (I don't expect A to be down for a long time), ideally I think I should sync the user db between all 3 servers so that if someone makes an account on B while A is down can later log on A when it is back up. Does ejabberd provide a mechanism for that?

edit: The solution needs to work with these constraints/use-case:

  • you can connect to any node of the cluster transparently
  • works if at least one of the node is up (no single point of failure)
  • works over the internet (potentially high latency)
knarf
  • 141
  • 7

1 Answers1

4

You need to follow the clustering guide here http://docs.ejabberd.im/admin/guide/clustering/

Anubioz
  • 3,597
  • 17
  • 23
  • Can you confirm that a) you can connect to any node of the cluster transparently, b) works if at least one of the node is up (no single point of failure) c) works over the internet (potentially high latency) – knarf Dec 02 '15 at 14:11
  • Yes, you should be able to connect to any node transparently in multi-master cluster mode. [Be sure to check this](https://github.com/chadillac/ejabberd-easy_cluster). As of performance - they say [ejabberd easily supports 70 million clients in League of Legends](http://highscalability.com/blog/2014/10/13/how-league-of-legends-scaled-chat-to-70-million-players-it-t.html) – Anubioz Dec 02 '15 at 18:54
  • But the document says that clustering across regions in not recommended. *"The clustering in ejabberd Community Edition relies on low latency networking. While it may work across regions, it is recommended that you run an ejabberd cluster in a single Amazon region."* – cnst Dec 04 '15 at 10:24
  • I confirm it is not recommended over internet. It will not recover automatically from netsplit that can happen over internet. Moreover, distributed transactions may last longer over slower network and could become a bottleneck. – Mickaël Rémond Dec 28 '15 at 10:06