
10.8(现在改成了10.37)上的操作
Shell >vi /etc/sysconfig/network-scripts/ifcfg-eth0
去掉IP
Shell >vi /etc/sysconfig/network-scripts/ifcfg-eth1
去掉IP
Shell >service network restart
Shell >/etc/init.d/heartbeat stop
Shell >/etc/init.d/ldirectord stop
10.37(现在改成了10.8)上的操作:
Shell>vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Xen Virtual Ethernet
DEVICE=eth0
BOOTPROTO=none
HWADDR=7A::F8:3B:AA:C5
ONBOOT=yes
IPADDR=211.144.147.234
NETMASK=255.255.255.192
GATEWAY=211.144.147.193
TYPE=Ethernet
Shell>service network restart
Shell> vi /etc/sysconfig/network
HOSTNAME=lvs02
Shell>vi /etc/hosts
211.144.147.233 lvs01
211.144.147.234 lvs02
shell> vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.eth0.send_redirects = 0
net.ipv4.conf.eth1.send_redirects = 0
shell> sysctl -p
shell> vi /etc/ha.d/authkeys
auth 2
2 sha1 HI!
shell> chmod 600 /etc/ha.d/authkeys
shell> vi /etc/ha.d/ha.cf
logfile /var/log/ha-log
keepalive 5
deadtime 30
warntime 10
initdead 120
udpport 694
bcast eth1
ucast eth0 211.144.147.234
auto_failback on
watchdog /dev/watchdog
node lvs01 lvs02
ping 211.144.147.193
respawn hacluster /usr.lib/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster
use_logd no
shell> vi /etc/ha.d/haresources
lvs01 211.144.147.235 ldirectord::ldirectord.cf
lvs01 211.144.147.236 ldirectord::ldirectord.cf
lvs01 211.144.147.237 ldirectord::ldirectord.cf
lvs01 211.144.147.249 ldirectord::ldirectord.cf
shell> vi /etc/ha.d/ldirectord.cf
checktimeout=3
checkinterval=1
autoreload=yes
logfile="/var/log/ldirectord.log"
quiescent=yes
virtual=211.144.147.235:80
real=211.144.147.238:80 gate
real=211.144.147.239:80 gate
fallback=127.0.0.1:80 gate
service=http
scheduler=wlc
#persistent=600
#netmask=255.255.255.255
protocol=tcp
checktype=negotiate
checkport=80
virtual=211.144.147.236:80
real=211.144.147.238:80 gate
real=211.144.147.239:80 gate
fallback=127.0.0.1:80 gate
service=http
scheduler=wlc
#persistent=600
#netmask=255.255.255.255
protocol=tcp
checktype=negotiate
checkport=80
virtual=211.144.147.237:80
real=211.144.147.238:80 gate
real=211.144.147.239:80 gate
fallback=127.0.0.1:80 gate
service=http
scheduler=wlc
#persistent=600
#netmask=255.255.255.255
protocol=tcp
checktype=negotiate
checkport=80
virtual=211.144.147.249:80
real=211.144.147.252:80 gate
real=211.144.147.253:80 gate
fallback=127.0.0.1:80 gate
service=http
scheduler=wlc
persistent=300
#netmask=255.255.255.255
protocol=tcp
checktype=connect
checkport=80
shell> chkconfig --level 35 heartbeat on
shell> service heartbeat start
shell> chkconfig --level 35 ldirectord on
shell> service ldirectord start
测试:
/etc/init.d/heartbeat status
/etc/init.d/ldirectord status
Ipvsadm –l
ifconfig
10.7上的操作
Shell >vi /etc/ha.d/haresources
lvs01 211.144.147.235 ldirectord::ldirectord.cf
lvs01 211.144.147.236 ldirectord::ldirectord.cf
lvs01 211.144.147.237 ldirectord::ldirectord.cf
lvs01 211.144.147.249 ldirectord::ldirectord.cf
shell >vi /etc/ha.d/ldirectord.cf
添加:virtual=211.144.147.249:80
real=211.144.147.252:80 gate
real=211.144.147.253:80 gate
fallback=127.0.0.1:80 gate
service=http
scheduler=wlc
persistent=300
#netmask=255.255.255.255
protocol=tcp
checktype=connect
checkport=80
shell >/etc/init.d/heartbeat restart
shell >/etc/init.d/ldirectord restart
查看:
/etc/init.d/heartbeat status
/etc/init.d/ldirectord status
Ipvsadm –l
Ifconfig
/usr/lib/heartbeat/hb_standby 是否能够切过去!然后再切回来。
http://am.agent.b2b.cn
http://hao.b2b.cn
