[vserver] LVS and Vserver - Success with DR

From: Christian Balzer <chibi_at_gol.com>
Date: Thu 15 Apr 2010 - 10:11:41 BST
Message-ID: <20100415181141.53ba8931@batzmaru.gol.ad.jp>

Hello,

having promised ages ago to try this and never finding anything but
failures when googling for it, here is how I've done it. This is done in
LVS-DR mode, which is the most efficient one but also tends to be the most
tricky one. LVS-TUN and NAT are left as exercises for the reader. ^o^

The basics, though I'm relative sure that any 2.3 Vserver would have
worked:
Kernel : 2.6.33.2-vs2.3.0.36.30.4
HostOS : Debian Squeeze (meaning util-vserver 0.30.216-pre2864-1)
GuestOS : Debian Lenny
LVSOS : Debian Squeeze

On the LVS server (really a HA cluster, but who's counting) a typical
ldirectord/ipvsadmin config:

---
# Global Directives
checktimeout=10
checkinterval=2
autoreload=yes
#logfile="local0"
quiescent=yes
# Virtual Server for HTTP
virtual=10.10.0.88:80
#        fallback=127.0.0.1:80
        real=10.10.0.32:80 gate
        real=10.10.0.33:80 gate
        service=http
#        request="index.html"
#        receive="Test Page"
#       persistent = 600
        scheduler=sh
        protocol=tcp
        checktype=connect
        emailalertfreq=600
        emailalert=root
---
On the Vserver hosts (just one with 2 guests on would of course work as
well but make a lot less sense ^_^) the typical sysctl modifications to
prevent ARP disasters (would go into /etc/sysctl.d/lvs-dr.conf for example):
---
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.eth1.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.eth0.arp_announce = 2
net.ipv4.conf.eth1.arp_announce = 2
---
And yes, this was on the host. And got exported automagically to the guest.
Not sure if and how namespaces might break this in the future.
Finally in the vserver configs for each of the 2 "real" (ahahahah, lovely
clash of LVS and Vserver terminology) servers an additional interface for
the "virtual" IP of the LVS, in this case:
File						Contents
/etc/vservers/guest1/interfaces/1/dev		lo
/etc/vservers/guest1/interfaces/1/ip		10.10.0.88
/etc/vservers/guest1/interfaces/1/prefix	32
That's it. Rather more straightforward and successful than I expected it
to be.
Regards,
Christian
-- 
Christian Balzer        Network/Systems Engineer                
chibi@gol.com   	Global OnLine Japan/Fusion Communications
http://www.gol.com/
Received on Thu Apr 15 10:12:07 2010
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 15 Apr 2010 - 10:12:10 BST by hypermail 2.1.8