How do I rename my Red Hat Enterprise Linux High Availability cluster?
Environment
- Red Hat Enterprise Linux 7, 8, 9, 10 (with the High Availability Add-on)
Issue
- How do I change the name of my Pacemaker cluster?
pcs property listshows the old cluster name even though/etc/corosync/corosync.confwas updated with the new name.
# pcs property list
Cluster Properties:
cluster-infrastructure: corosync
cluster-name: clusteru1
dc-version: XXXXX
have-watchdog: false
symmetric-cluster: true
# pcs status | grep "Cluster name"
Cluster name: clusteru1
Resolution
Note: There is no way to change the cluster name in runtime. The cluster stack will need to be stopped then started on all nodes for the new cluster name to take effect.
Note: The pacemaker attribute cluster-name is only modified if the attribute does not exist. The attribute is not updated when the cluster_name attribute changes in corosync.
Note: If you're using one or more shared volume groups with lvmlockd and dlm, then you will need to take a downtime for this procedure. See the section Handing dlm volume groups below.
Changing the cluster name
-
Delete the pacemaker attribute
cluster-name. Thecluster-nameattribute will be set to the value ofcluster_nameconfigured in/etc/corosync/corosync.confthe next time thatpacemakeris stopped then started.# crm_attribute --type crm_config --name cluster-name --delete -
Edit
/etc/corosync/corosync.confon one node and replace thecluster_namevalue.cluster_name: <new cluster name> -
Sync the configuration change between nodes.
# pcs cluster sync -
Restart the entire cluster stack on all cluster nodes. Once
pacemakerstarts again then it will set the attributecluster-namesince it does not exist.# pcs cluster stop --all # pcs cluster start --all -
Verify that the property is now set correctly.
# corosync-cmapctl -g totem.cluster_name # crm_attribute --type crm_config --name cluster-name --query
Changing the cluster name with pcs
With this errata, the pcs cluster rename command has been introduced.
Red Hat Enterprise Linux 9
- This issue This content is not included.RHEL-76055 has been resolved with the errata RHBA-2025:20705 for RHEL 9.7 that provides the following package(s):
pcs-snmp-0.11.10-1.el9,pcs-0.11.10-1.el9.
Red Hat Enterprise Linux 10
- This issue This content is not included.RHEL-22423 has been resolved with the errata RHBA-2025:20253 for RHEL 10.1 that provides the following package(s):
cockpit-ha-cluster-0.12.1-1.el10,pcs-snmp-0.12.1-1.el10,pcs-0.12.1-1.el10.
As a result, you can now easily change the name of an existing cluster. The cluster (pacemaker and corosync) stack has to be stopped on all cluster nodes in order to change the name.
For example, we want to change the cluster name to clusteru1.
$ pcs cluster stop --all
$ pcs cluster rename clusteru1
$ pcs cluster start --all --wait
Handling dlm volume groups
For RHEL8+ Cluster, where shared volume groups are configured with lvmlockd and dlm, then the dlm cluster name in the volume group metadata must be changed so that the volume groups can start after the cluster name is changed.
-
Disable the
LVM-activateorFilesystemresources that use the shared volume groups.# pcs resource disable <lvm_resource_name> # pcs resource disable <fs_resource_name> -
Perform steps 1 through 4 from the cluster name change procedure above.
-
With
pacemakerand theocf:pacemaker:controldandocf:heartbeat:lvmlockdresources running, perform the following steps (copied from thelvmlockd(8)man page):# # Change the VG lock type to none: # vgchange --lock-type none --lock-opt force <vgname> # # Change the VG lock type back to dlm which sets the new cluster name: # vgchange --lock-type dlm <vgname> # On each cluster node, start the VG: # vgchange --lock-start <vgname> -
Re-enable LVM-activate resource(s) that you disabled in step 1 and clear the fail-count.
# pcs resource enable <lvm_resource_name> # pcs resource cleanup <lvm_resource_name> -
Confirm LVM-activate resource(s) active status.
# pcs status -
If the shared volume groups contain
gfs2filesystems, then update the lock table name for each filesystem. See the following solution: Do I need to make changes to my GFS/GFS2 file systems when renaming the cluster in RHEL? -
Re-enable File system resource(s) that you disabled in step 1.
# pcs resource enable <fs_resource_name> -
Confirm File system resource(s) active status.
# pcs status
Root Cause
Updating /etc/corosync/corosync.conf with a new cluster name and restarting the cluster does not update the cluster-name property in Pacemaker.
Diagnostic Steps
-
The
cluster-nameproperty is set to the old cluster name.# pcs property list | grep cluster-name cluster-name: <new cluster name> -
/etc/corosync/corosync.confuses the new cluster name.totem { version: 2 secauth: off cluster_name: clusteru1 <---- Updated transport: udpu }
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.