I'm trying to loadbalance some containers using ldirectord and DR mode, but so far I don't seem to be able to get the networking part going.
Setup is with 3 containers, one running the director and the other two being the real servers. Eventually I'd like two have 2 containers in HA with a VIP, but for the sake of doing one thing at a time I'm not implementing this part yet.
The setup requires the following:
- ip_vs module, which I modprobed on the host and then seemed to be available in the director container
- director needs to be able to forward traffic, ie net.ipv4.ip_forward = 1 . This seemed to get applied with sysctl -p
The real servers is where the problem starts:
- first you need a dummy interface so that apache or whatever can respond with the vip, however you don't want to arp for it, so you need to set some sysctls however this fails badly:
sysctl: cannot stat /proc/sys/net/ipv4/conf/all/ARP_ignore: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv4/conf/eth0/ARP_ignore: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv4/conf/all/ARP_announce: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv4/conf/eth0/ARP_announce: No such file or directory
- second you need to set up an additional ip on lo for the VIP. I thought this would have not been permitted as in general I had to add things to the profile for devices to show up, but unexpectedly it went through, even tho nothing worked in the end (apache will never listen on it and once I add it networking breaks and the instance doesn't even ping anymore):
lo:0 Link encap:Local Loopback
inet addr:10.11.5.16 Mask:255.255.255.255
UP LOOPBACK RUNNING MTU:65536 Metric:1
any thoughts? should this setup be possible on lxc? this is a fairly ok guide on the topic for reference: https://www.suse.com/communities/blog/load-balancing-howto-lvs-ldirectord-heartbeat-2/