6.0 Managing a Cluster

Heartbeat ships with a comprehensive set of tools that assist you in managing your cluster from the command line. This chapter introduces the tools needed for managing the cluster configuration in the CIB and the cluster resources. Other command line tools for managing resource agents or tools used for debugging and troubleshooting your setup are covered in Section 7.0, Creating Resources and Section 8.0, How can I clean up my resources?.

The following list presents several tasks related to cluster management and briefly introduces the tools to use to accomplish these tasks:

Monitoring the Cluster's Status

The crm_mon command allows you to monitor your cluster's status and configuration. Its output includes the number of nodes, uname, uuid, status, the resources configured in your cluster, and the current status of each. The output of crm_mon can be displayed at the console or printed into an HTML file. When provided with a cluster configuration file without the status section, crm_mon creates an overview of nodes and resources as specified in the file. See Display the cluster configuration laid out in an existing cluster configuration file (filename), group the resources by node, and include inactive resources. This command can be used for dry-runs of a cluster configuration before rolling it out to a live cluster. for a detailed introduction to this tool's usage and command syntax.

Managing the CIB

The cibadmin command is the low-level administrative command for manipulating the Heartbeat CIB. It can be used to dump all or part of the CIB, update all or part of it, modify all or part of it, delete the entire CIB, or perform miscellaneous CIB administrative operations. See --sync-call, -s for a detailed introduction to this tool's usage and command syntax.

Managing Configuration Changes

The crm_diff command assists you in creating and applying XML patches. This can be useful for visualizing the changes between two versions of the cluster configuration or saving changes so they can be applied at a later time using --sync-call, -s. See --stdin, -s for a detailed introduction to this tool's usage and command syntax.

Manipulating CIB Attributes

The crm_attribute command lets you query and manipulate node attributes and cluster configuration options that are used in the CIB. See Change the value of the location attribute in the nodes section for the myhost host: for a detailed introduction to this tool's usage and command syntax.

Validating the Cluster Configuration

The crm_verify command checks the configuration database (CIB) for consistency and other problems. It can check a file containing the configuration or connect to a running cluster. It reports two classes of problems. Errors must be fixed before Heartbeat can work properly while warning resolution is up to the administrator. crm_verify assists in creating new or modified configurations. You can take a local copy of a CIB in the running cluster, edit it, validate it using crm_verify, then put the new configuration into effect using cibadmin. See Pipe a configuration into crm_verify and produce verbose output: for a detailed introduction to this tool's usage and command syntax.

Managing Resource Configurations

The crm_resource command performs various resource-related actions on the cluster. It lets you modify the definition of configured resources, start and stop resources, or delete and migrate resources between nodes. See Recheck one node for resources started outside the CRM: for a detailed introduction to this tool's usage and command syntax.

Managing Resource Fail Counts

The crm_failcount command queries the number of failures per resource on a given node. This tool can also be used to reset the failcount, allowing the resource to again run on nodes where it had failed too often. See Query the current failcount for the resource myrsc on the node node1: for a detailed introduction to this tool's usage and command syntax.

Generate and Retrieve Node UUIDs

UUIDs are used to identify cluster nodes to ensure that they can always be uniquely identified. The command crm_uuid displays the UUID of the node on which it is run. In very rare circumstances, it may be necessary to set a node's UUID to a known value. This can also be achieved with crm_uuid, but you should use this command with extreme caution. For more information, refer to --read, -r.

Managing a Node's Standby Status

The crm_standby command can manipulate a node's standby attribute. Any node in standby mode is no longer eligible to host resources and any resources that are there must be moved. Standby mode can be useful for performing maintenance tasks, such as kernel updates. Remove the standby attribute from the node as it should become a fully active member of the cluster again. See Have a node go to standby until the next reboot of this node: for a detailed introduction to this tool's usage and command syntax.