Using two nodes:
- node1: 192.168.0.1
- node2: 192.168.0.2
Installed HA tools on both servers:
yum install pacemaker pcs
(It will include install corosync)
On both servers:
Set same password for cluster.
On both servers:
systemctl enable pcsd.service systemctl start pcsd.service
Authenticating the cluster nodes:
node1# pcs cluster auth 192.168.0.1 192.168.0.2
All of them successful authenticated.
Generating the corosync configuration:
node1# pcs cluster setup --name mycluster 192.168.0.1 192.168.0.2
Starting the cluster:
node1# pcs cluster start --all
pcs status corosync Output Membership information ---------------------- Nodeid Votes Name 2 1 192.168.0.2 1 1 192.168.0.1 (local)
Get more information about the current status of the cluster:
pcs cluster status Output Cluster Status: ... Stack: corosync ... 2 nodes and 0 resources configured Online: [ node1 node2 ] PCSD Status: node1 (192.168.0.1): Online node2 (192.168.0.2): Online
Enable the corosync and pacemaker services on both servers:
systemctl enable corosync.service systemctl enable pacemaker.service
node1# pcs property set stonith-enabled=false
After created a float IP and added it to pcs resource, test failover.
Then got trouble. After it rebooted, run
pcs cluster status again, it showed:
Cluster Status: Stack: corosync Current DC: centos7lb1 (version 1.1.15-11.el7_3.5-e174ec8) - partition WITHOUT quorum Last updated: Sun Jul 23 23:47:53 2017 Last change: Fri Jul 21 05:56:32 2017 by hacluster via crmd on node1 1 node and 0 resources configured PCSD Status: node1 (192.168.0.1): Online *Unknown* (192.168.0.2): Online
pcs status on node1:
Cluster name: mycluster WARNING: corosync and pacemaker node names do not match (IPs used in setup?) Stack: corosync Current DC: node1 (version 1.1.15-11.el7_3.5-e174ec8) - partition WITHOUT quorum Last updated: Sun Jul 23 23:58:22 2017 Last change: Fri Jul 21 05:56:32 2017 by hacluster via crmd on node1 1 node and 0 resources configured Online: [ node1 ] No resources Daemon Status: corosync: active/disabled pacemaker: active/disabled pcsd: active/enabled
node2 in the cluster. At the same time check the status on node2, got only one node(
node2), too. The same as node1, can't find another node in the cluster.
I tried to remove pacemaker, corosync and pcs and redo it again. But after do that like:
yum remove pacemaker pcs
Then authenticate them:
pcs cluster auth node1 node2
At this time, how to join the two nodes into the cluster rightly again? I want to remove them clearly, then how to do?