準備條件:html
node 192.168.56.101 node1
node
192.168.56.103 node2
vim
VIP 192.168.56.111
bash
配置好ssh 無密鑰登錄,ntp對時
ssh
Ha 1:curl
yum install net-snmp-libs libnet PyXML rpm-ivh heartbeat-2.1.4-12.el6.x86_64.rpm heartbeat-pils-2.1.4-12.el6.x86_64.rpm heartbeat-stonith-2.1.4-12.el6.x86_64.rpm yum install httpd
編輯ha.cf 文件ide
vim /etc/ha.cf添加內容以下:url
logfacility local0#日誌使用rsyslog中local0設定spa
keepalive1 #監聽頻率,每1秒日誌
deadtime3 #死亡判斷時間
warntime2 #異常警告時間
mcasteth0 225.0.0.1 694 1 0 #組播地址設定
auto_failbackon #修復後自動上線
node HAnode1 #節點設置
node HAnode2#節點設置
ping 192.168.56.102 #第三方仲裁設定
HA2 配置與HA1相同惟一的區別就是index.html 文件
[root@HAntfs ~]# curl http://192.168.56.111/index.html ha1
[root@HAntfs ~]# curl http://192.168.56.111/index.html ha2