How to configure a stonith device using agent fence_gce in a Red Hat High Availability cluster with pacemaker?
Environment
- Red Hat Enterprise Linux 7, 8 or 9 (with the High Availability Add-on)
- One or more nodes running as Cloud Instance
- Pacemaker
Issue
- How to configure stonith agent fence_gce in a RHEL cluster with pacemaker.
Resolution
-
On each node of the cluster ensure that the
fence-agents-gcepackage is installed. If this package is not present on the nodes, proceed to install it on all the cluster nodes :# yum install fence-agents-gce -
Ensure the
fence_gcecommand is able to list the GCP instance names from all nodes of cluster using thefence_gcecommand below :# fence_gce --zone us-west1-b --project=rhel-ha-on-gcp -o list [root@rhel71-node-01 ~] # fence_gce --zone us-west1-b --project=rhel-ha-testing-on-gcp -o list 44358**********3181,InstanceName-3 40819**********6811,InstanceName-1 71736**********3341,InstanceName-2Note: The output also shows the internal ID for the instance. For more information on
fence_gcecommands refer# man fence_gce -
Create the stonith device using the command below :
# pcs stonith create FenceDeviceName fence_gce zone=Region-Zone project=MyProject
Use the pcmk_host_map attribute in the command if the node names and instance names are different. pcmk_host_map is used to map each node name as seen by Pacemaker to the corresponding Google Instance name as seen by the GCP Compute Engine. (For more information on the correct format for pcmk_host_map, refer to the solution: What format should I use to specify node mappings to stonith devices in pcmk_host_list and pcmk_host_map in a RHEL High Availability pacemaker cluster?
- To know more information of the stonith agent
fence_gceand stonith options that can be configured with it, use the command# pcs stonith describe fence_gce
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.