The above operations also need implement on lvs-s.
4、Configure HA
lvs-m# vi ha.cf
modfiy:
#logfile /var/log/ha-log
#keepalive 2
#deadtime 30
#warntime 10
#initdead 120
#udpport 694
#bcast eth0 # Linux
ucast eth0 192.168.1.2
#node ken3
#node kathy
#ping 10.10.10.254
to:
logfile /var/log/ha-log
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport 694
bcast eth0 # Linux
ucast eth0 192.168.1.222 //lvs-s's IP
node lvs-m # the node name must same as the output of "uname -n"
node lvs-s # the node name must same as the output of "uname -n"
ping 192.168.1.222 //lvs-s's IP
The above operations also need implement on lvs-s.
Attention the ip address.
5、Configure auth mode
lvs-m# vi authkeys
modfiy:
#auth 1
#1 crc
to:
auth 1
1 crc
lvs-m# chomd 600 autkeys
The above operations also need implement on lvs-s.
6、Configure virtual Service
lvs-m# vi haresources
Removin all then add following line:
lvs-m IPaddr::192.168.1.220/32/eth0:0 ldirectord //here, node lvs-m works as master
the lvs-s server as follows:
lvs-m IPaddr::192.168.1.220/32/eth0:0 ldirectord //here, node lvs-m works as master
If we configure them work as master/master mode, and the vip on lvs-s is 192.168.1.230, the configuration in both haresources files as follows:
lvs-m IPaddr::192.168.1.220/32/eth0:0 ldirectord
lvs-s IPaddr::192.168.1.230/32/eth0:0 ldirectord
The above operations also need implement on lvs-s.
On Web server
web-n# vi /root/vip.sh
Add:
################################################################################
# Virtual IP Setup
################################################################################
ifconfig lo:0 192.168.1.220 broadcast 192.168.1.220 netmask 255.255.255.255 up
route add -host 192.168.1.220 dev lo:0
################################################################################
# The end
################################################################################