LLI Wiki — My Digital Knowledge Base

Pacemaker: pcs commands and fencing (STONITH)

Main pcs commands to manage a Pacemaker cluster and the STONITH fencing principle.

Pacemaker is the resource manager of a high-availability cluster on Linux. This page summarises the most useful pcs commands and the principle of fencing (STONITH).

Fencing (STONITH)

STONITH (Shoot The Other Node In The Head) isolates a failed or unreliable node by stopping or rebooting it before its resources are taken over by another node. This prevents concurrent writes to the same resource. Fencing is provided by a dedicated agent, configured as a stonith resource.

References: fencing in a Pacemaker cluster, STONITH on VMware virtual machines.

Useful files

Location Description
/var/lib/pacemaker/cib/cib.xml main cluster configuration
/var/log/cluster/corosync.log main cluster log
/usr/lib/ocf/resource.d/heartbeat/ resource agent scripts

Cluster status

Command Description
pcs cluster status status of the cluster nodes
pcs status --full detailed status of nodes and resources
pcs resource status of resources and resource groups

Node management

Command Description
pcs cluster standby put a node in standby mode
pcs cluster unstandby take a node out of standby mode

Managing running resources

Command Description
pcs resource move <resource> <node> move a resource to another node
pcs resource restart <resource> restart the resource on the current node
pcs resource enable <resource> start the resource on the current node
pcs resource disable <resource> stop the resource on the current node

Debugging

Command Description
pcs resource debug-start <resource> force a start on this node, showing debug information
pcs resource debug-stop <resource> force a stop on this node, showing debug information
pcs resource debug-monitor <resource> force a monitor on this node, showing debug information

Add --full to these commands for more verbose output.

Creating and modifying resources

Command Description
pcs resource agents list the available resource agents
pcs resource describe <agent> list the parameters of an agent
pcs resource create <id> <agent> [options] create a resource
pcs resource show <id> show the configuration of a resource
pcs resource update <id> [options] update a resource
pcs resource delete <id> delete a resource
pcs resource cleanup <id> clear the failures of a resource

Creating and modifying stonith resources

Command Description
pcs stonith list list the available fence agents
pcs stonith describe <agent> list the parameters of a fence agent
pcs stonith describe <stonith_id> list the parameters of a stonith resource
pcs stonith create <stonith_id> <agent> [options] create a stonith resource
pcs stonith show <stonith_id> show the configuration
pcs stonith update <stonith_id> [options] update the configuration
pcs stonith delete <stonith_id> delete the resource
pcs stonith cleanup <stonith_id> clear the failures

pcs or crm

The tool to use depends on the distribution: pcs on Red Hat Enterprise Linux and its clones, crmsh on SUSE Linux Enterprise. The Pacemaker documentation is the common reference.

Remarks

Mastodon LLIMastodon SocialFosstodon