The Red Hat High Availability Add-on allows a cluster administrator to control the resources and resource groups running in the cluster. Resources and resource groups may be started and stopped by the cluster administrator. Restrictions can be enforced to temporarily prohibit a resource or resource group from migrating to a specific cluster node, or to move a resource or resource group away from the node it is currently running on, and temporarily prohibit the resource from migrating back to the node it was moved from. The restrictions can be very helpful for starting maintenance on particular cluster nodes and minimizing service downtime by minimizing the amount of service migration by manual intervention with the cluster operation.
Stop and start cluster resources
Cluster resources and resource groups can be stopped at any time to ensure they are not running on the cluster. This can be controlled by a cluster administrator with pcs resource disable name and pcs resource enable name for stopping and starting a resource, respectively. To stop all resources in the resource group someservice, execute:
# pcs resource disable someservice
Once stopped, a resource or resource group can be started again on the cluster. To start the resource group someservice on the cluster, execute:
# pcs resource enable someservice
Move cluster resources
Resources and resource groups may be moved away from the cluster node where they are currently running with pcs resource move name. Optionally, a target node can be added to the command to specify the node to which the resource or resource group should be moved. This feature is very helpful if a cluster node has a maintenance window, for example, to apply errata. To move the resource group someservice to nodec, execute:
# pcs resource move someservice nodec
Prohibit a resource from migrating to a specific node
A cluster administrator can prevent a resource temporarily from migrating to a specific cluster node. The pcs resource ban name command prohibits the resource from running on the node where it currently runs. Optionally, a particular node can be added as a parameter on the command line to restrict the resource from migrating to the specified node. To prevent the resource group apacheweb from running on noded, execute:
# pcs resource ban apacheweb noded.private.example.com
Both pcs resource move and pcs resource ban will create a temporary constraint rule on the cluster. Constraints are used, among other reasons, to influence which resources can run where. When a move command is used without a target, a Disabled rule with a score of – INFINITY will be created for the original node. When a move command is used with a target, an Enabled rule will be created (or moved) for the new target node, with a score of INFINITY.
For a cluster administrator, it is important to understand the behavior of the configured services on the cluster. The command pcs constraint list allows an administrator to get an overview of the currently configured constraints in the cluster. In the following example, the resource group myresourcegroup has been banned from running on nodec.
# pcs constraint list Location Constraints: Resource: myresourcegroup Disabled on: nodec.private.example.com (score:-INFINITY) (role: Started) ...
Remove temporary resource restrictions
The temporary restrictions added by the pcs resource ban and pcs resource move commands can be removed for a particular resource with pcs resource clear name. Optionally, a node can be added as a parameter on the command line to only remove restrictions for the given resource on a particular cluster node. To clear the ban restriction for the ftpserv resource group on nodec, execute:
# pcs resource clear ftpserv hod.ec.private.example.com
How to Create and Configure Resource Groups in a Pacemaker Cluster