Pacemaker Command Line Tools

Tool Summary

attrd_updater

attrd_updater − Tool for updating cluster node attributes

cibadmin

cibadmin − Provides direct access to the cluster configuration.

Allows the configuration, or sections of it, to be queried, modified, replaced and deleted.

Where necessary, XML data will be obtained using the −X, −x, or −p options.

cibsecret

cibsecret − A tool for managing cib secrets

usage: cibsecret [−C] <command> <parameters> −−version Display version information, then exit

−C: don’t read/write the CIB

command: set | delete | stash | unstash | get | check | sync

set <rsc> <param> <value>

get <rsc> <param>

check <rsc> <param>

stash <rsc> <param> (if not −C)

unstash <rsc> <param> (if not −C)

delete <rsc> <param>

sync

stash/unstash: move the parameter from/to the CIB (if you already have the parameter set in the CIB).

set/delete: add/remove a parameter from the local file.

get: display the parameter from the local file.

check: verify MD5 hash of the parameter from the local file and the CIB.

sync: copy /var/lib/pacemaker/lrm/secrets to other nodes.

EXAMPLES

cibsecret set ipmi_node1 passwd SecreT_PASS

cibsecret stash ipmi_node1 passwd

cibsecret get ipmi_node1 passwd

cibsecret check ipmi_node1 passwd

cibsecret sync

AUTHOR

Written by Andrew Beekhof


crm_attribute

crm_attribute − Manage node’s attributes and cluster options.

Allows node attributes and cluster options to be queried, modified and deleted.

crm_diff

crm_diff − crm_diff can compare two Pacemaker configurations (in XML format) to produce a custom diff−like output, or apply such an output as a patch

crm_error

crm_error − Tool for displaying the textual name or description of a reported error code

crm_failcount

crm_failcount − Query or delete resource fail counts

Common options:

−−help

Display this text, then exit

−−version

Display version information, then exit

−V, −−verbose

Specify multiple times to increase debug output

−q, −−quiet

Print only the value (if querying)

Commands:
−G
, −−query

Query the current value of the resource’s fail count

−D, −−delete

Delete resource’s recorded failures

Additional Options:
−r
, −−resource=value

Name of the resource to use (required)

−n, −−operation=value

Name of operation to use (instead of all operations)

−I, −−interval=value

If operation is specified, its interval

−N, −−node=value

Use failcount on named node (instead of local node)

AUTHOR

Written by Andrew Beekhof


crm_master

crm_master − Query, update, or delete a resource’s promotion score

This program should normally be invoked only from inside an OCF resource agent.

Common options:

−−help

Display this text, then exit

−−version

Display version information, then exit

−V, −−verbose

Specify multiple times to increase debug output

−q, −−quiet

Print only the value (if querying)

Commands:
−G
, −−query

Query the current value of the promotion score

−v, −−update=VALUE

Update the value of the promotion score

−D, −−delete

Delete the promotion score

Additional Options:
−N
, −−node=NODE

Use promotion score on named node (instead of local node)

−l, −−lifetime=VALUE

Until when should the setting take effect (valid values: reboot, forever)

−i, −−id=VALUE

(Advanced) XML ID used to identify promotion score attribute

AUTHOR

Written by Andrew Beekhof


crm_mon

crm_mon − Provides a summary of cluster’s current state.

Outputs varying levels of detail in a number of different formats.

crm_node

crm_node − Tool for displaying low−level node information

crm_report

crm_report − Create archive of everything needed when reporting cluster problems

Required option:
−f
, −−from TIME

time prior to problems beginning (as "YYYY−M−D H:M:S" including the quotes)

crm_resource

crm_resource − Perform tasks related to cluster resources. Allows resources to be queried (definition and location), modified, and moved around the cluster.

crm_shadow

crm_shadow − Perform configuration changes in a sandbox before updating the live cluster.

Sets up an environment in which configuration tools (cibadmin, crm_resource, etc) work offline instead of against a live cluster, allowing changes to be previewed and tested for side−effects.

crm_simulate

crm_simulate − Tool for simulating the cluster’s response to events

crm_standby

crm_standby − Query, enable, or disable standby mode for a node

Nodes in standby mode may not host cluster resources.

Common options:

−−help

Display this text, then exit

−−version

Display version information, then exit

−V, −−verbose

Specify multiple times to increase debug output

−q, −−quiet

Print only the standby status (if querying)

Commands:
−G
, −−query

Query the current value of standby mode (on/off)

−v, −−update=VALUE

Update the value of standby mode (on/off)

−D, −−delete

Let standby mode use default value

Additional Options:
−N
, −−node=NODE

Operate on the named node instead of the current one

−l, −−lifetime=VALUE

Until when should the setting take effect (valid values: reboot, forever)

−i, −−id=VALUE

(Advanced) XML ID used to identify standby attribute

AUTHOR

Written by Andrew Beekhof


crm_ticket

crm_ticket − Perform tasks related to cluster tickets. Allows ticket attributes to be queried, modified and deleted.

crm_verify

crm_verify − check a Pacemaker configuration for errors

Check the well−formedness of a complete Pacemaker XML configuration,

its conformance to the configured schema, and the presence of common

misconfigurations. Problems reported as errors must be fixed before the

cluster will work properly. It is left to the administrator to decide

whether to fix problems reported as warnings.

crmadmin

crmadmin − Development tool for performing some controller−specific commands.

Likely to be replaced by crm_node in the future

fence_legacy

Helper that presents a Pacemaker−style interface for Linux−HA stonith plugins

Should never be invoked by the user directly

fence_pcmk

Helper that presents a RHCS−style interface to stonith−ng for CMAN based clusters

Should never need to use invoked by the user directly

iso8601

iso8601 − Display and parse ISO8601 dates and times

pacemaker-remoted

pacemaker−remoted − Resource agent executor daemon for Pacemaker Remote nodes

pacemaker_remoted

pacemaker_remoted − Pacemaker Remote daemon for extending pacemaker functionality to remote nodes.

pacemakerd

pacemakerd − Start/Stop Pacemaker

stonith_admin

stonith_admin − access the Pacemaker fencing API

The Right Tool for the Job

Pacemaker ships with a comprehensive set of tools that assist you in managing your cluster from the command line. Here we introduce the tools needed for managing the cluster configuration in the CIB and the cluster 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 crm_mon(8) 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 Pacemaker 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 cibadmin(8) 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 cibadmin(8). See crm_diff(8) 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 crm_attribute(8) 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 Pacemaker 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 crm_verify(8) 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 crm_resource(8) 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 crm_failcount(8) for a detailed introduction to this tool's usage and command syntax.

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 crm_standby(8) for a detailed introduction to this tool's usage and command syntax.