So after setting up the first ejabberd node (im1), with a test virtual host and working LDAP integration, I setup our second ejabberd node (im2) by copying /etc/ejabberd/ejabberd.cfg to the 2nd node, then running through the following steps:
After you quit the shell, you'll most likely need to move the result mnesia database files to the ejabberd user's $HOME folder.
Once, both nodes were working correctly I setup a LVS-DR load balancer with ldirectord. This proves to be rather straightforward.
First the realservers (each ejabberd instance, im1 and im2) had to configured with a local interface that listens to the load balancer's VIP (virtual IP). The most reliable way I found to set this up was with a simple
ip addr add 172.16.254.60/32 brd + dev lo label lo:vipin /etc/rc.local.
Then I setup a /etc/sysctl.d/60-ipvs-arp-rules.conf with
net.ipv4.conf.eth0.arp_ignore = 1On Ubuntu (and I think debian as well), you must also tweak /etc/sysctl.d/10-network-security.conf to disable source address validation
net.ipv4.conf.eth0.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.default.rp_filter=0That's pretty much it for the realservers.
Setting up the loadbalancer involves setting up the VIP in /etc/network/interfaces
auto eth0:vip0Then setting up ldirectord (apt-get install ldirectord) in /etc/ldirectord.cf with
iface eth0:vip0 inet static
/etc/ldirectord.cfIt'd be really cool if there was some kind of builtin heathcheck call you could do on an ejabberd node, but alas there isn't so I just send it a string of garbage ("junk" to be exact), and look for the jabber.org string in the XMPP response. Seems to be working OK thus far...
# Global Directives