Product SiteDocumentation Site

Cap. 4. Pacemaker Tools

Cuprins

4.1. Folosirea Utilitarelor Pacemaker

4.1. Folosirea Utilitarelor Pacemaker

În trecutul întunecat, configurarea Pacemaker necesita ca administratorul să citească și să scrie XML. În stilul adevărat UNIX, existau și un număr de comenzi diferite care se specializau în diferitele aspecte ale interogării și actualizării clusterului.
Începând cu Pacemaker 1.0, acest lucru s-a schimbat și avem un shell de cluster integrat, scriptabil, care ascunde toată schela neordonată de XML. Chiar vă permite să adăugați într-o coadă de așteptare mai multe schimbări și să le aplicați în mod atomic.
Luați-vă ceva timp pentru a vă familiariza cu ceea ce poate să facă.
# crm --help
usage:
    crm [-D display_type]
    crm [-D display_type] args
    crm [-D display_type] [-f file]

    Use crm without arguments for an interactive session.
    Supply one or more arguments for a "single-shot" use.
    Specify with -f a file which contains a script. Use '-' for
    standard input or use pipe/redirection.

    crm displays cli format configurations using a color scheme
    and/or in uppercase. Pick one of "color" or "uppercase", or
    use "-D color,uppercase" if you want colorful uppercase.
    Get plain output by "-D plain". The default may be set in
    user preferences (options).

Examples:

    # crm -f stopapp2.cli
    # crm < stopapp2.cli
    # crm resource stop global_www
    # crm status
The primary tool for monitoring the status of the cluster is crm_mon (also available as crm status). It can be run in a variety of modes and has a number of output options. To find out about any of the tools that come with Pacemaker, simply invoke them with the --help option or consult the included man pages. Both sets of output are created from the tool, and so will always be in sync with each other and the tool itself.
Additionally, the Pacemaker version and supported cluster stack(s) are available via the --feature option to pacemakerd.
# pacemakerd --features
Pacemaker 1.1.9-3.fc20.2 (Build: 781a388)
 Supporting v3.0.7:  generated-manpages agent-manpages ncurses libqb-logging libqb-ipc upstart systemd nagios  corosync-native
# pacemakerd --help
pacemakerd - Start/Stop Pacemaker

Usage: pacemakerd mode [options]
Options:
 -?, --help 		This text
 -$, --version 		Version information
 -V, --verbose 		Increase debug output
 -S, --shutdown 		Instruct Pacemaker to shutdown on this machine
 -F, --features 		Display the full version and list of features Pacemaker was built with

Additional Options:
 -f, --foreground 		(Ignored) Pacemaker always runs in the foreground
 -p, --pid-file=value		(Ignored) Daemon pid file location

Report bugs to pacemaker@oss.clusterlabs.org
# crm_mon --help
crm_mon - Provides a summary of cluster's current state.

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

Usage: crm_mon mode [options]
Options:
 -?, --help 		This text
 -$, --version 		Version information
 -V, --verbose 		Increase debug output
 -Q, --quiet 		Display only essential output

Modes:
 -h, --as-html=value	Write cluster status to the named html file
 -X, --as-xml 		Write cluster status as xml to stdout. This will enable one-shot mode.
 -w, --web-cgi 		Web mode with output suitable for cgi
 -s, --simple-status 	Display the cluster status once as a simple one line output (suitable for nagios)

Display Options:
 -n, --group-by-node 		Group resources by node
 -r, --inactive 		Display inactive resources
 -f, --failcounts 		Display resource fail counts
 -o, --operations 		Display resource operation history
 -t, --timing-details 		Display resource operation history with timing details
 -c, --tickets 			Display cluster tickets
 -W, --watch-fencing 			Listen for fencing events. For use with --external-agent, --mail-to and/or --snmp-traps where supported
 -A, --show-node-attributes 	Display node attributes

Additional Options:
 -i, --interval=value		Update frequency in seconds
 -1, --one-shot 		Display the cluster status once on the console and exit
 -N, --disable-ncurses 		Disable the use of ncurses
 -d, --daemonize 		Run in the background as a daemon
 -p, --pid-file=value		(Advanced) Daemon pid file location
 -E, --external-agent=value	A program to run when resource operations take place.
 -e, --external-recipient=value	A recipient for your program (assuming you want the program to send something to someone).

Examples:

Display the cluster status on the console with updates as they occur:

	# crm_mon

Display the cluster status on the console just once then exit:

	# crm_mon -1

Display your cluster status, group resources by node, and include inactive resources in the list:

	# crm_mon --group-by-node --inactive

Start crm_mon as a background daemon and have it write the cluster status to an HTML file:

	# crm_mon --daemonize --as-html /path/to/docroot/filename.html

Start crm_mon and export the current cluster status as xml to stdout, then exit.:

	# crm_mon --as-xml


Report bugs to pacemaker@oss.clusterlabs.org

Notă

Dacă opțiunile de SNMP și/sau email nu sunt listate, atunci Pacemaker nu a fost construit pentru a le suporta. Acest lucru s-ar putea întâmpla din alegerea făcută de distribuția folosită sau librăriile necesare ar putea să nu fie disponibile. Vă rugăm să contactați pe oricine v-a furnizat pachetele pentru mai multe detalii.