四、corosync+pacemaker配置
1、安装将所需软件包
#node1
[root@node1 ~]# yum localinstall *.rpm -y
#node2
[root@node2 ~]# yum localinstall *.rpm -y
2、配置
# cd /etc/corosync/
# cp -p corosync.conf.example corosync.conf
#vim corosync.conf
3、node1、node2上分别创建日志目录
# mkdir /var/log/cluster
# ssh node2 "mkdir /var/log/cluster"
4、集群验证
[root@node1 corosync]# corosync-keygen
Corosync Cluster Engine Authentication key generator.
Gathering 1024 bits for key from /dev/random.
Press keys on your keyboard to generate entropy.
Writing corosync key to /etc/corosync/authkey
//拷贝给node2要保留权限
[root@node1 corosync]# scp -p authkey node2:/etc/corosync/
5、启动服务
# service corosync start
6、验证corosync引擎是否正常启动了
[root@node1 corosync]# grep -i -e "corosync cluster engine" -e "configuration file" /var/log/messages
Jan 22 21:31:22 node1 smartd[4176]: Opened configuration file /etc/smartd.conf
Jan 22 21:31:22 node1 smartd[4176]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Jan 22 23:37:02 node1 corosync[2943]: [MAIN ] Corosync Cluster Engine ('1.2.7'): started and ready to provide service.
Jan 22 23:37:02 node1 corosync[2943]: [MAIN ] Successfully read main configuration file '/etc/corosync/corosync.conf'.
7、查看初始化成员节点通知是否发出
[root@node1 corosync]# grep -i totem /var/log/messages

8、检查过程中是否有错误产生
[root@node1 corosync]#grep -i error: /var/log/messages |grep -v unpack_resources (避免stonith的错误)

9、检查pacemaker的启动情况
[root@node1 corosync]# grep -i pcmk_startup /var/log/messages

