How do I change my currently configured heartbeat interface for RHEL 7 Pacemaker?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 7 w/ High Availability

Issue

After assigning our public interface for heartbeat communication during cluster setup, it's been determined we'd like to use a different network interface for corosync communication. How do we go about changing this in an existing cluster?

Resolution

1. Open the /etc/corosync/corosync.conf

2. Review the nodelist section of the configuration

nodelist {
  node {
        ring0_addr: pcm2
        nodeid: 1
       }
  node {
        ring0_addr: pcm1
        nodeid: 2
       }

3. Modify the ring*_addr assignment to the hostname or IP of the appropriate interface for each node

nodelist {
  node {
        ring0_addr: pcm2-priv
        nodeid: 1
       }
  node {
        ring0_addr: pcm1-priv
        nodeid: 2
       }
nodelist {
  node {
        ring0_addr: 192.168.0.1
        nodeid: 1
       }
  node {
        ring0_addr: 192.168.0.2
        nodeid: 2
       }

4. Propagate the change to the other node.

# pcs cluster sync

If you get any error in the above step which mentions to run 'pcs cluster auth' then perform step 7 after this.

5. Make sure that all addresses specified in the corosync.conf are defined in the /etc/hosts file of all cluster nodes:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.1     pcm1-priv
192.168.0.2     pcm2-priv

6. corosync must be restarted on all nodes at once for the change to go into effect, which will require a cluster downtime. The simplest way to mange this is to stop the cluster on all nodes, and then start it again:

# pcs cluster stop --all
# pcs cluster start --all

7. Once the change has been put in place, you'll need to re-authenticate using the new interface. This can be done by running:

# pcs cluster auth

and then fill in the requested information (user: hacluster passwd: hacluster users password)

8. Also update the constraints and stonith configuration with the new node names as the constraints and stonith configuration will not be updated automatically.

# pcs constraint show --full
Location Constraints:
  Resource: myfence
    Disabled on: pcm1 (score:-INFINITY) (id:location-myfence-pcm1--INFINITY)
  Resource: myfence1
    Disabled on: pcm2 (score:-INFINITY) (id:location-myfence1-pcm2--INFINITY)
Ordering Constraints:
Colocation Constraints:

# pcs constraint remove location-myfence-pcm1--INFINITY
# pcs constraint remove location-myfence1-pcm2--INFINITY

# pcs constraint location myfence avoids pcm1-priv
# pcs constraint location myfence1 avoids pcm2-priv

# pcs stonith show --full
 Resource: myfence (class=stonith type=fence_ipmilan)
  Attributes: ipaddr=pcm1-imm.gsslab.pnq.redhat.com login=USERID passwd=password power_wait=5 power_timeout=20 pcmk_host_list=pcm1 pcmk_host_map=pcm1-priv:pcm1.gsslab.pnq.redhat.com lanplus=on 
  Operations: monitor interval=60s (myfence-monitor-interval-60s)
 Resource: myfence1 (class=stonith type=fence_ipmilan)
  Attributes: ipaddr=pcm2-imm.gsslab.pnq.redhat.com login=USERID passwd=password power_wait=5 power_timeout=20 pcmk_host_list=pcm2 pcmk_host_map=pcm2:pcm2.gsslab.pnq.redhat.com lanplus=on 
  Operations: monitor interval=60s (myfence1-monitor-interval-60s)

# pcs stonith update myfence fence_ipmilan ipaddr=pcm1-imm.gsslab.pnq.redhat.com login=<USERID> passwd=<password> power_wait=5 power_timeout=20 pcmk_host_list=pcm1-priv pcmk_host_map=pcm1-priv:pcm1.gsslab.pnq.redhat.com lanplus=on 

# pcs stonith update myfence1 fence_ipmilan ipaddr=pcm2-imm.gsslab.pnq.redhat.com login=<USERID> passwd=<password> power_wait=5 power_timeout=20 pcmk_host_list=pcm2-priv pcmk_host_map=pcm2-priv:pcm2.gsslab.pnq.redhat.com lanplus=on 

Root Cause

The ring0_addr value is determined by your pcs cluster setup command, so you could assign any interface you want during cluster creation. If you wish to change it after the fact, you can modify the corosync.conf to point at the appropriate hostname or ip address however corosync will need to be restarted on all nodes for the change to take effect.

If you'd like more information about defining your heartbeat interfaces during initial cluster setup, please see the following article:

How can I configure my cluster to use a specific network interface for communication with other nodes?

SBR
Components

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.