CentOS 7
Sponsored Link

Pacemaker : Install2015/06/23

Install and Configure Linux High-Availability Cluster tool "Pacemaker".
This example is based on the environment like follows. Configure basic cluster environment on here.
+----------------------+          |          +----------------------+
| [       Node01     ] | || [       Node02     ] |
|   node01.srv.world   +----------+----------+   node02.srv.world   |
|                      |                     |                      |
+----------------------+                     +----------------------+

[1] Install Pacemaker like follows on all Nodes.
[root@node01 ~]#
yum -y install pacemaker pcs
[root@node01 ~]#
systemctl start pcsd

[root@node01 ~]#
systemctl enable pcsd
# set password for cluster admin user

[root@node01 ~]#
passwd hacluster

Changing password for user hacluster.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[2] If Firewalld is running, allow service port.
[root@node01 ~]#
firewall-cmd --add-service=high-availability --permanent

[root@node01 ~]#
firewall-cmd --reload

[3] Configure like follows on a Node.
# establish authorization

[root@node01 ~]#
pcs cluster auth node01.srv.world node02.srv.world


node01.srv.world: Authorized
node02.srv.world: Authorized
# configure cluster

[root@node01 ~]#
pcs cluster setup --name ha_cluster node01.srv.world node02.srv.world

Destroying cluster on nodes: node01.srv.world, node02.srv.world...
node01.srv.world: Stopping Cluster (pacemaker)...
node02.srv.world: Stopping Cluster (pacemaker)...
node01.srv.world: Successfully destroyed cluster
node02.srv.world: Successfully destroyed cluster

Sending 'pacemaker_remote authkey' to 'node01.srv.world', 'node02.srv.world'
node02.srv.world: successful distribution of the file 'pacemaker_remote authkey'
node01.srv.world: successful distribution of the file 'pacemaker_remote authkey'
Sending cluster config files to the nodes...
node01.srv.world: Succeeded
node02.srv.world: Succeeded

Synchronizing pcsd certificates on nodes node01.srv.world, node02.srv.world...
node02.srv.world: Success
node01.srv.world: Success
Restarting pcsd on the nodes in order to reload the certificates...
node02.srv.world: Success
node01.srv.world: Success

# start srvices for cluster

[root@node01 ~]#
pcs cluster start --all

node02.srv.world: Starting Cluster...
node01.srv.world: Starting Cluster...
# enable cluster

[root@node01 ~]#
pcs cluster enable --all

node01.srv.world: Cluster Enabled
node02.srv.world: Cluster Enabled
# show status

[root@node01 ~]#
pcs status cluster

Cluster Status:
 Stack: corosync
 Current DC: node01.srv.world (version 1.1.16-12.el7_4.2-94ff4df) - partition with quorum
 Last updated: Mon Oct 15 10:22:12 2017
 Last change: Mon Oct 15 10:21:57 2017 by hacluster via crmd on node01.srv.world
 2 nodes configured
 0 resources configured

PCSD Status:
  node01.srv.world: Online
  node02.srv.world: Online

[root@node01 ~]#
pcs status corosync

Membership information
    Nodeid      Votes Name
         1          1 node01.srv.world (local)
         2          1 node02.srv.world
Matched Content