pcs
pcs
is a command-line tool used to manage and configure high-availability clusters based on Pacemaker and Corosync. It allows administrators to manage cluster nodes, configure resources, control failover and fencing, and more. Below are some common pcs
commands and their subcommands:
Cluster Management
pcs cluster start [nodes]
Starts the Pacemaker cluster on specified nodes.pcs cluster stop [nodes]
Stops the cluster on the specified nodes.pcs cluster status
Displays the status of the entire cluster.pcs cluster enable --all
Enables the cluster to automatically start on boot for all nodes.pcs cluster disable --all
Disables the cluster from starting automatically on boot.pcs cluster destroy
Removes the cluster configuration, essentially destroying the cluster setup.
Resource Management
pcs resource create [resource-name] [type] [options]
Creates a resource in the cluster. Resources can be services, IP addresses, filesystems, or other cluster-managed entities.pcs resource delete [resource-name]
Deletes a resource from the cluster.pcs resource restart [resource-name]
Restarts a specific resource.pcs resource status
Displays the status of all resources.pcs resource manage [resource-name]
Enables manual management of the resource, preventing Pacemaker from managing it automatically.pcs resource unmanage [resource-name]
Reverts a manually managed resource back to automatic management by Pacemaker.
Node Management
pcs node standby [node-name]
Places the specified node into standby mode, preventing it from hosting resources.pcs node unstandby [node-name]
Removes the node from standby mode, allowing it to host resources again.pcs node remove [node-name]
Removes a node from the cluster.
Fencing and STONITH
pcs stonith create [name] [type] [options]
Creates a STONITH (Shoot The Other Node In The Head) fencing device to reboot or power off a node in case of failure.pcs stonith delete [stonith-device-name]
Deletes a STONITH device.pcs stonith status
Displays the status of all STONITH devices.
Constraint Management
pcs constraint location [resource-name] prefers [node-name]
Sets a location preference for a resource to run on a particular node.pcs constraint colocation add [resource1] with [resource2]
Ensures that two resources run on the same node (or different nodes using a negative score).pcs constraint order start [resource1] then [resource2]
Sets the order in which resources are started or stopped.
Quorum and Status
pcs quorum status
Shows quorum status for the cluster.pcs status
Displays a high-level overview of the cluster, including nodes, resources, and fencing devices.pcs config
Shows the current cluster configuration.
Property and Options Management
pcs property set [property-name]=[value]
Sets cluster-wide properties, such as enabling or disabling STONITH.pcs resource defaults
Displays or sets default values for resource options such as timeouts or monitoring intervals.
pcs
is a comprehensive tool for managing Pacemaker/Corosync-based high-availability clusters. It provides rich functionality to configure, monitor, and troubleshoot clusters effectively, ensuring uptime and reliability in critical systems.
Last updated