= Pacemaker Tools =

== Simplify administration using a cluster shell ==

In the dark past, configuring Pacemaker required the administrator to
read and write XML.  In true UNIX style, there were also a number of
different commands that specialized in different aspects of querying
and updating the cluster.

All of that has been greatly simplified with the creation of unified
command-line shells (and GUIs) that hide all the messy XML
scaffolding.

These shells take all the individual aspects required for managing and
configuring a cluster, and pack them into one simple-to-use command
line tool.

They even allow you to queue up several changes at once and commit
them all at once.

Two popular command-line shells are `pcs` and
`crmsh`.  This edition of Clusters from Scratch is based on `pcs`.

[NOTE]
===========
The two shells share many concepts but the scope, layout and syntax
does differ, so make sure you read the version of this guide that
corresponds to the software installed on your system.
===========

== Explore pcs ==

Start by taking some time to familiarize yourself with
what `pcs` can do.

----
[root@pcmk-1 ~]# pcs
Usage: pcs [-f file] [-h] [commands]...
Control and configure pacemaker and corosync.

Options:
    -h, --help  Display usage and exit
    -f file     Perform actions on file instead of active CIB
    --debug     Print all network traffic and external commands run
    --version   Print pcs version information

Commands:
    cluster     Configure cluster options and nodes
    resource    Manage cluster resources
    stonith     Configure fence devices
    constraint  Set resource constraints
    property    Set pacemaker properties
    acl         Set pacemaker access control lists
    status      View cluster status
    config      View and manage cluster configuration
----

As you can see, the different aspects of cluster management are separated
into categories: resource, cluster, stonith, property, constraint,
and status. To discover the functionality available in each of these
categories, one can issue the command +pcs pass:[<replaceable>category</replaceable>] help+.  Below
is an example of all the options available under the status category.

----
[root@pcmk-1 ~]# pcs status help
Usage: pcs status [commands]...
View current cluster and resource status
Commands:
    [status] [--full]
        View all information about the cluster and resources (--full provides
        more details)

    resources
        View current status of cluster resources

    groups
        View currently configured groups and their resources

    cluster
        View current cluster status

    corosync
        View current membership information as seen by corosync

    nodes [corosync|both|config]
        View current status of nodes from pacemaker. If 'corosync' is
        specified, print nodes currently configured in corosync, if 'both'
        is specified, print nodes from both corosync & pacemaker.  If 'config'
        is specified, print nodes from corosync & pacemaker configuration.

    pcsd <node> ...
        Show the current status of pcsd on the specified nodes

    xml
        View xml version of status (output from crm_mon -r -1 -X)
----

Additionally, if you are interested in the version and
supported cluster stack(s) available with your Pacemaker
installation, run:

----
[root@pcmk-1 ~]# pacemakerd --features
Pacemaker 1.1.12 (Build: a14efad)
 Supporting v3.0.9:  generated-manpages agent-manpages ascii-docs publican-docs ncurses libqb-logging libqb-ipc upstart systemd nagios  corosync-native atomic-attrd acls
----

[NOTE]
======
If the SNMP and/or email options are not listed, then Pacemaker was not
built to support them. This may be by the choice of your distribution, or
the required libraries may not have been available. Please contact
whoever supplied you with the packages for more details.
======
