LVS実験

LVSサーバーは、eth0にサービスIPのIP Aliasを設定


auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
address 192.168.24.40 ←サービスIP
netmask 255.255.255.0

あとは、設定ファイルにいろいろ設定

# ipvsadm.rules
-A -t 192.168.24.40:80 -s rr
-a -t 192.168.24.40:80 -r 192.168.24.30:80 -g -w 1
root@lvs0:~# cat /etc/default/ipvsadm
# ipvsadm
# if you want to start ipvsadm on boot set this to true
AUTO=”true”
# daemon method (none|master|backup)
DAEMON=”master”
# use interface (eth0,eth1…)
IFACE=”eth0″
# syncid to use
SYNCID=”1″



物理サーバーの設定はこんな風に設定

auto lo:0
iface lo:0 inet static
address 192.168.24.40 ←サービスIP
netmask 255.255.255.255