一、安装heartbeat。
HA前提:1、时间同步; 2、SSH双机互信; 3、主机名称要与uname -n一致,并通过/etc/hosts解析; rpm -ivh epel-release-6-8.noarch.rpm #配置epel的源 下载地址: yum -y install heartbeat cp /usr/share/doc/heartbeat-3.0.4/{authkeys,ha.cf,haresources} /etc/ha.d/ 三个配置文件: 1、密钥文件,600, /etc/ha.d/authkeys 2、heartbeat服务的配置配置/etc/ha.d/ha.cf 3、资源管理配置文件/etc/ha.d/haresources vim /etc/ha.d/authkeys auth 1 1 md5 0aa5b0ea86dc20192a9f25726ecd5a8a vim /etc/ha.d/ha.cf debugfile /var/log/ha-debug logfile /var/log/ha-log keepalive 5 deadtime 30 warntime 10 udpport 695 #同一Vlan如果有多个组需要改端口 bcast eth0 # 广播 auto_failback on node node1.niiwoo.com #添加节点 node node2.niiwoo.com ping 192.168.18.1 vim /etc/ha.d/haresources #配置资源 node1 IPaddr::192.168.18.80/24/eth0 httpd #Pacemaker相关 [root@node1 ~]# vim /etc/ha.d/ha.cf pacemaker respawn ln -s /usr/libexec/pacemaker/cib /usr/lib64/heartbeat/cib ln -s /usr/libexec/pacemaker/stonithd /usr/lib64/heartbeat/stonithd ln -s /usr/libexec/pacemaker/attrd /usr/lib64/heartbeat/attrd ln -s /usr/libexec/pacemaker/crmd /usr/lib64/heartbeat/crmd