Please go to my Main page for HA-Clusters to see setup information and links to guides I used to create this.
I will first make 1 CentOS Template.
Then I will configure the template as much as I can before creating two node VM's keeping template as a backup. This assures consistent configuration. For Authentication, the same user account must be present on both machines. [hacluster]
Install and create user "hacluster"
yum install -y pacemaker cman ccs psmisc policycoreutils-python resource-agents python-setuptools python-lxml ruby wget && echo "passwd" | passwd hacluster --stdin
Install PCS from Source : (Newest Version can be found here)
cd /usr/src wget https://github.com/feist/pcs/archive/0.9.151.tar.gz tar xvzf 0.9.151.tar.gz cd pcs*
make install && pcs
Note : You can also move ahead with the following links before splitting into 2 VM's
#) Configure DRBD for Linux HA Cluster - PaceMaker - Corosync - Ext4
#) Create Eth0:* NIC Alias's for DRBD
Now you need to clone VM Template into 2 "nodes" [node1 & node2] (keeping template just incase!)
Configue Cluster :
Run on BOTH nodes :
pcs cluster setup --local --name VoIP_Cluster node1 node2 -u hacluster -p passwd
"CMAN was originally written for rgmanager and assumes the cluster should not start until the node has quorum, so before we try to start the cluster, we need to disable this behavior:"
Quoted from ClusterLabs
echo "CMAN_QUORUM_TIMEOUT=0" >> /etc/sysconfig/cman
service cman start service pacemaker start
Run on PRIMARY node :
Disable STONTIH :
pcs property set stonith-enabled=false
Disable Quorum : (For less than 3 node clusters AKA 2-node clusters)
pcs property set no-quorum-policy=ignore
pcs cluster start --all
Check Status :
Note: I can take a bit for the resource to start, be patient, wait a minute! (Try pcs status resources again in a moment)
Important Note : "In this example, we are not enabling the corosync and pacemaker services to start at boot. If a cluster node fails or is rebooted, you will need to run pcs cluster start nodename (or --all) to start the cluster on it. While you could enable the services to start at boot, requiring a manual start of cluster services gives you the opportunity to do a post-mortem investigation of a node failure before returning it to the cluster." - ClusterLabs
That's it, you have a working PaceMaker + Corosync setup.
Next Step --> Create a Floating/VirtualIP
Startup Script :
cat << EOL > /root/startcluster.sh #/bin/bash service cman start service pacemaker start pcs cluster start --all pcs status EOL
chmod a+x /root/startcluster.sh