系统环境:RHEL6.0 iptables & selinux disabled
软件环境:
heartbeat-3.0.4-1.el6.x86_64.rpm
heartbeat-libs-3.0.4-1.el6.x86_64.rpm
ldirectord-3.9.2-1.2.x86_64.rpm
ipvsadm-1.25-9.el6.x86_64
# egrep -v "#|^$" /etc/ha.d/ha.cf
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 10
warntime 5
initdead 40
udpport 694
auto_failback on
watchdog /dev/watchdog
node server26.example.com
node host26.example.com
ping 192.168.0.254
respawn hacluster /usr/lib64/heartbeat/ipfail
# egrep -v "#|^$" /etc/ha.d/haresources
server26.example.com IPaddr::192.168.0.222/24/eth0 httpd
# egrep -v "#|^$" /etc/ha.d/authkeys
auth 3
3 md5 Hello!
节点:
/etc/sysctl.conf
net.ipv4.conf.lo.arp_announce = 1
net.ipv4.conf.lo.arp_ignore = 2
net.ipv4.conf.all.arp_announce = 1
net.ipv4.conf.all.arp_ignore = 2
sysctl -p
ifconfig eth0:0 192.168.0.222 netmask 255.255.255.255
route add -host 192.168.0.222 eth0:0
echo `hostname` > /var/www/html/index.html
/etc/init.d/httpd start
管理端:
/etc/init.d/ipvsadm restart
ipvsadm -A -t 192.168.0.222:80 -s rr
ipvsadm -a -t 192.168.0.222:80 -r 192.168.0.226:80 -g
ipvsadm -a -t 192.168.0.222:80 -r 192.168.0.126:80 -g
/etc/init.d/ipvsadm save
ifconfig eth0:0 192.168.0.222 netmask 255.255.255.255
ipvsadm -L //查看状态
阅读(2008) | 评论(0) | 转发(0) |