1、用yum安装heartbeat、libnet安装包。(heartbeat需要安装两次,第一次安装的为一些依赖文件)
2、将/usr/share/doc/heartbeat 下ha.cf,haesources,authkeys三个文件复制到/etc/ha.d下。
3、ln -s /etc/ha.d /usr/etc/ha.d 做软连接
4、修改配置文件ha.cf、haresources、authkeys
ha.cf
debugfile、logfile 配置调试日志路径。
logfacility
keepalive 2
deadtime 5
warntime 1250ms
initdead 20
udpport 694
ucast 对方IP
ping 网关
auto_failback on
#auto_failback off
#respawn hacluster /usr/lib/heartbeat/ipfail
#respawn hacluster /usr/lib/heartbeat/ipfail
// 两台主机名(修改/etc/hosts,/etc/sysconfig/network)
node xrhao
node xrTwo
haresources资源文件