This is pacemaker plugin based cluster, and not recommemded for RHEL/CentOS 6, you should switch to CMAN based pacemaker cluster. For more info, please check: http://blog.clusterlabs.org/blog/2013/pacemaker-on-rhel6-dot-4/
1. Make sure you have successfully set up DNS resolution and NTP time synchronization for both your Linux Cluster nodes.
vi /etc/sysconfig/network
设定主机名为short name, not FQDN
here, I use /etc/hosts to simplify
vi /etc/hosts
# eth0 network for production
192.168.1.15 zabbixweb01
192.168.1.25 zabbixweb02
# for dedicated heartbeat network to avoid problems
# eth1 network
10.10.10.1 zabbixweb01p
10.10.10.2 zabbixweb02p
2. wget http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-6/network:ha-clustering:Stable.repo -O /etc/yum.repos.d/ha.repo
3. on two nodes
yum -y install pacemaker corosync crmsh
4. on node 1
cp /etc/corosync/corosync.conf.sample /etc/corosync/corosync.conf
vi /etc/corosync/corosync.conf
# Please read the corosync.conf.5 manual page
compatibility: whitetank
totem {
version: 2
secauth: off
threads: 0
interface {
ringnumber: 0
bindnetaddr: 10.10.10.0
mcastaddr: 226.94.1.1
mcastport: 5405
ttl: 1
}
}
logging {
fileline: off
to_stderr: no
to_logfile: yes
to_syslog: no
logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
logger_subsys {
subsys: AMF
debug: off
}
}
amf {
mode: disabled
}
5. vi /etc/logrotate.d/corosync
/var/log/cluster/corosync.log {
missingok
compress
notifempty
daily
rotate 7
copytruncate
}
6. vi /etc/corosync/service.d/pcmk
service {
# Load the Pacemaker Cluster Resource Manager
name: pacemaker
ver: 1
}
7. Copy /etc/corosync/corosync.conf, /etc/corosync/service.d/pcmk, /etc/logrotate.d/corosyncto the second Linux Cluster node 2
8. on node 1
service corosync start
9. verify corosync is running correctly
a. grep -e "corosync.*network interface" -e "Corosync Cluster Engine" -e "Successfully read main configuration file" /var/log/cluster/corosync.log
b. grep TOTEM /var/log/cluster/corosync.log
c. grep pcmk_startup /var/log/cluster/corosync.log
d. grep -e pacemakerd.*get_config_opt -e pacemakerd.*start_child -e "Starting Pacemaker" /var/log/cluster/corosync.log
e. grep ERROR: /var/log/cluster/corosync.log | grep -v unpack_resources
service pacemaker start
chkconfig corosync on
chkconfig pacemaker on
10. on node 2
service corosync start
service pacemaker start
chkconfig corosync on
chkconfig pacemaker on
11. for a two nodes cluster, run from one node
crm configure property stonith-enabled="false"
crm configure property no-quorum-policy="ignore"
#crm configure rsc_defaults resource-stickiness="100"