How to remove pacemaker, corosync and pcs thoroughly on CentOS 7

centos7clustercorosyncpacemakerremove

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:

passwd hacluster

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

Success.

Confirm status:

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

Disabling STONITH

node1# pcs property set stonith-enabled=false

After created a float IP and added it to pcs resource, test failover.

On node1:

reboot

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

Run 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

Can't find 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

Showed they Already authorized.

At this time, how to join the two nodes into the cluster rightly again? I want to remove them clearly, then how to do?

Best Answer

The reason was the firewall.

Because Corosync uses UDP transport on ports 5404 and 5405, I added:

iptables -I INPUT -m state --state NEW -p udp -m multiport --dports 5404,5405 -j ACCEPT
iptables -I OUTPUT -m state --state NEW -p udp -m multiport --sports 5404,5405 -j ACCEPT
service iptables save

and stop/start all cluster:

pcs cluster stop --all
pcs cluster start --all

Also ran:

service corosync restart

The cluster works. All the nodes can been seen and all of them online.

Related Topic