Pacemaker : Install2025/02/26 |
|
Install and Configure Linux High Availability System, Pacemaker. This example is based on the environment like follows.
|
+----------------------+ | +----------------------+
| [ Cluster Node#1 ] |10.0.0.51 | 10.0.0.52| [ Cluster Node#2 ] |
| node01.srv.world +----------+----------+ node02.srv.world |
| | | |
+----------------------+ +----------------------+
|
| [1] | On all Nodes, Install Pacemaker and configure some settings. |
|
# enable [HighAvailability] repo and install (disabled by default) [root@node01 ~]# dnf --enablerepo=highavailability -y install pacemaker pcs
[root@node01 ~]#
systemctl enable --now pcsd
# set cluster admin password [root@node01 ~]# passwd hacluster Changing password for user hacluster. New password: Retype new password: passwd: all authentication tokens updated successfully. |
| [2] | On all Nodes, If Firewalld is running, allow HA service. |
|
[root@node01 ~]# firewall-cmd --add-service=high-availability success [root@node01 ~]# firewall-cmd --runtime-to-permanent success |
| [3] | On a Node, Configure basic Cluster settings. |
|
# authorize among nodes [root@node01 ~]# pcs host auth node01.srv.world node02.srv.world Username: hacluster Password: node01.srv.world: Authorized node02.srv.world: Authorized # configure cluster [root@node01 ~]# pcs cluster setup ha_cluster node01.srv.world node02.srv.world No addresses specified for host 'node01.srv.world', using 'node01.srv.world' No addresses specified for host 'node02.srv.world', using 'node02.srv.world' Destroying cluster on hosts: 'node01.srv.world', 'node02.srv.world'... node02.srv.world: Successfully destroyed cluster node01.srv.world: Successfully destroyed cluster Requesting remove 'pcsd settings' from 'node01.srv.world', 'node02.srv.world' node01.srv.world: successful removal of the file 'pcsd settings' node02.srv.world: successful removal of the file 'pcsd settings' Sending 'corosync authkey', 'pacemaker authkey' to 'node01.srv.world', 'node02.srv.world' node02.srv.world: successful distribution of the file 'corosync authkey' node02.srv.world: successful distribution of the file 'pacemaker authkey' node01.srv.world: successful distribution of the file 'corosync authkey' node01.srv.world: successful distribution of the file 'pacemaker authkey' Sending 'corosync.conf' to 'node01.srv.world', 'node02.srv.world' node02.srv.world: successful distribution of the file 'corosync.conf' node01.srv.world: successful distribution of the file 'corosync.conf' Cluster has been successfully set up. # start services for cluster [root@node01 ~]# pcs cluster start --all node01.srv.world: Starting Cluster... node02.srv.world: Starting Cluster... # set auto-start [root@node01 ~]# pcs cluster enable --all node01.srv.world: Cluster Enabled node02.srv.world: Cluster Enabled # show status [root@node01 ~]# pcs cluster status Cluster Status: Cluster Summary: * Stack: corosync (Pacemaker is running) * Current DC: node02.srv.world (version 3.0.0-5.el10-1353d31) - partition with quorum * Last updated: Wed Feb 26 08:46:23 2025 on node01.srv.world * Last change: Wed Feb 26 08:43:26 2025 by hacluster via hacluster on node02.srv.world * 2 nodes configured * 0 resource instances configured Node List: * Online: [ node01.srv.world node02.srv.world ] 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
|
| [4] | If you'd like to remove all cluster settings to initialize, run like follows. |
|
[root@node01 ~]# pcs cluster stop --all node01.srv.world: Stopping Cluster (pacemaker)... node02.srv.world: Stopping Cluster (pacemaker)... node01.srv.world: Stopping Cluster (corosync)... node02.srv.world: Stopping Cluster (corosync)...[root@node01 ~]# pcs cluster destroy --all
Warning: It is recommended to run 'pcs cluster stop' before destroying the cluster.
WARNING: This would kill all cluster processes and then PERMANENTLY remove cluster state and configuration
Type 'yes' or 'y' to proceed, anything else to cancel: yes
Warning: Unable to load CIB to get guest and remote nodes from it, those nodes will not be deconfigured.
node02.srv.world: Stopping Cluster (pacemaker)...
node01.srv.world: Stopping Cluster (pacemaker)...
node02.srv.world: Successfully destroyed cluster
node01.srv.world: Successfully destroyed cluster
|
| Sponsored Link |
|
|