Cluster configuration
Topics
Update user
hacluster
password
Change the password of the user haclustser
on both the nodes, as shown
in the following example:
[root@prihana ~]# passwd hacluster [root@sechana ~]# passwd hacluster
Start and enable the
pcs
services
The following commands start and enable the pcs
service on both the
nodes:
[root@prihana ~]# systemctl start pcsd.service [root@prihana ~]# systemctl enable pcsd.service
Authenticate pcs with user hacluster
The following command authenticates pcs
to the pcs
daemon
on the nodes in the cluster. The user name for the pcs
administration must
be hacluster
on both the nodes with the same password.
RHEL 7.x
[root@prihana ~]# pcs cluster auth prihana sechana Username: hacluster Password: sechana: Authorized prihana: Authorized [root@prihana ~]#
RHEL 8.x
[root@<host1> ~]# pcs host auth prihana sechana Username: hacluster Password: sechana: Authorized prihana: Authorized [root@<host1> ~]#
Review instance settings that conflict with cluster actions
To ensure that restarts are predictable, we recommend disabling simplified automatic recovery and not configuring Amazon CloudWatch action based recovery for instances that are part of a pacemaker cluster. Use the following command to disable simplified automatic recovery.
aws ec2 modify-instance-maintenance-options --instance-id i-0abcdef1234567890 --auto-recovery disabled
You must ensure that stop protection is disabled for Amazon EC2 instances that are part of a pacemaker cluster. Use the following command to disable stop protection.
aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --no-disable-api-stop
Set up the cluster
The following command configures the cluster configuration file and syncs the configuration on both the nodes.
pcs cluster setup –name rhelhanaha prihana sechana [rooteprihana~]pcs cluster setup --name rhelhanaha prihana sechana Destroying cluster on nodes: prihana, sechana... sechana: Stopping Cluster (pacemaker)... prihana: Stopping Cluster (pacemaker)... sechana: Successfully destroyed cluster prihana: Successfully destroyed cluster Sending 'pacemaker_remote authkey' to iprihana', 'sechana' prihana: successful distribution of the file 'pacemaker remote authkey' sechana: successful distribution of the file 'pacemaker_remote authkey' Sending cluster config files to the nodes... prihana: Succeeded sechana: Succeeded Synchronizing pcsd certificates on nodes prihana, sechana... saphdbdbe2: Success prihana: Success Restarting pcsd on the nodes in order to reload the certificates... sechana: Success prihana: Success
Enable and start the cluster
The following commands enable and start the cluster:
pcs cluster enable –all root@prihana etc]# pcs cluster enable --all prihana: Cluster Enabled sechana: Cluster Enabled
pcs cluster start –all [root@prihana etc]# pcs cluster start --all prihana: Starting Cluster (corosync)... sechana: Starting Cluster (corosync)... sechana: Starting Cluster (pacemaker)... prihana: Starting Cluster (pacemaker)... [rooteprihana etc]# I
Increase corosync totem token timeout
RHEL 7.x
-
Edit the
/etc/corosync/corosync.conf
file in all the cluster nodes and increase or add the value for token, as shown in the following example.totem { version: 2 secauth: off cluster_name: my-rhel-sap-cluster transport: udpu rrp_mode: passive token: 30000 <------ Value to be set }
-
Reload
corosync
by running the following command in only one cluster node to reload. This will not require any downtime.# pcs cluster reload corosync
-
Run the following command to confirm that your changes are active.
# corosync-cmapctl | grep totem.token Runtime.config.totem.token (u32) = 30000
RHEL 8.x
Run the following command to increase the corosync
token
timeout.
# pcs cluster config update totem token=29000