How to change the hostname of a Pacemaker Cluster node

This document (000020597) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise High Availability Extension 12
SUSE Linux Enterprise High Availability Extension 15
SUSE Linux Enterprise Server for SAP Applications 12
SUSE Linux Enterprise Server for SAP Applications 15

Situation

The hostname of a system that is a node of a Pacemaker Cluster must be changed.

IMPORTANT: this TID will only explain how to change the hostname of a system that is a node of a Pacemaker Cluster, based on the basic OS and Cluster configurations, and NOT how the change of the hostname will affect the applications, databases or any other software installed.

Resolution

This example is based on a two node cluster, where the hostname of the nodes are: "green" and "blue". And the hostname of node "blue" will be changed to "yellow", as follows:

1. Open a root session on node "blue" and set it into standby mode, this will move all the cluster resources running on "blue" to node "green":

crm node standby


2. Once done, open a root session on node "green", and remove node "blue" from the cluster:

crm cluster remove blue


3. On node "blue", disable all the cluster related services, so it will not start after reboot:

systemctl disable --now pacemaker

systemctl disable --now corosync

systemctl disable --now sbd



4. Change the hostname of node "blue" to "yellow":

hostnamectl set-hostname yellow


5. Verify that the hostname was changed to "yellow" and then reboot the system:

hostnamectl status

systemctl reboot



6. Once node "yellow" is back online, verify again that the hostname was properly changed to "yellow":

hostnamectl status


7. Edit the /etc/hosts file on all the nodes in the cluster, and replace the old hostname "blue" for "yellow" in all the respective entries.


8. Join the node to the cluster, on node "yellow" run as root:

ha-cluster-join

And follow the instructions on screen.

NOTE: while the above example shows the procedure on a two node cluster, it is also valid for clusters with more than two nodes.

 

Additional Information

If using DRBD then do not forget to replace the old hostname for the new one in all the /etc/drbd.d/*.res files.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000020597
  • Creation Date: 01-Mar-2022
  • Modified Date:01-Mar-2022
    • SUSE Linux Enterprise High Availability Extension
    • SUSE Linux Enterprise Server for SAP Applications

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center