Skip to content

Commit

Permalink
Merge pull request #817 from krig/quickref-update
Browse files Browse the repository at this point in the history
Doc: pcs-crmsh-quick-ref: Updates to the CLI quick ref
  • Loading branch information
kgaillot committed Oct 20, 2015
2 parents 604a2ee + a53aab9 commit f08e81c
Showing 1 changed file with 111 additions and 32 deletions.
143 changes: 111 additions & 32 deletions doc/pcs-crmsh-quick-ref.md
@@ -1,38 +1,46 @@
<!-- (new version of doctoc removed this, so added above:) -->
<!-- *generated with [DocToc](https://github.com/thlorenz/doctoc-web/)* -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- *generated with [DocToc](http://doctoc.herokuapp.com/)* -->
**Table of Contents**
**Table of Contents**

- [General Operations](#general-operations)
- [Display the configuration](#display-the-configuration)
- [Display the current status](#display-the-current-status)
- [Node standby](#node-standby)
- [Set cluster property](#set-cluster-property)
- [Display the configuration](#display-the-configuration)
- [Display the current status](#display-the-current-status)
- [Node standby](#node-standby)
- [Set cluster property](#set-cluster-property)
- [Resource manipulation](#resource-manipulation)
- [List Resource Agent (RA) classes](#list-resource-agent-ra-classes)
- [List available RAs](#list-available-ras)
- [List RA info](#list-ra-info)
- [Create a resource](#create-a-resource)
- [Display a resource](#display-a-resource)
- [Display fencing resources](#display-fencing-resources)
- [Display Stonith RA info](#display-stonith-ra-info)
- [Start a resource](#start-a-resource)
- [Stop a resource](#stop-a-resource)
- [Remove a resource](#remove-a-resource)
- [Modify a resource](#modify-a-resource)
- [Delete parameters for a given resource](#delete-parameters-for-a-given-resource)
- [List the current resource defaults](#list-the-current-resource-defaults)
- [Set resource defaults](#set-resource-defaults)
- [List the current operation defaults](#list-the-current-operation-defaults)
- [Set operation defaults](#set-operation-defaults)
- [Set Colocation](#set-colocation)
- [Set ordering](#set-ordering)
- [Set preferred location](#set-preferred-location)
- [Move resources](#move-resources)
- [Create a clone](#create-a-clone)
- [Create a master/slave clone](#create-a-masterslave-clone)
- [List Resource Agent (RA) classes](#list-resource-agent-ra-classes)
- [List available RAs](#list-available-ras)
- [List RA info](#list-ra-info)
- [Create a resource](#create-a-resource)
- [Display a resource](#display-a-resource)
- [Display fencing resources](#display-fencing-resources)
- [Display Stonith RA info](#display-stonith-ra-info)
- [Start a resource](#start-a-resource)
- [Stop a resource](#stop-a-resource)
- [Remove a resource](#remove-a-resource)
- [Modify a resource](#modify-a-resource)
- [Delete parameters for a given resource](#delete-parameters-for-a-given-resource)
- [List the current resource defaults](#list-the-current-resource-defaults)
- [Set resource defaults](#set-resource-defaults)
- [List the current operation defaults](#list-the-current-operation-defaults)
- [Set operation defaults](#set-operation-defaults)
- [Set Colocation](#set-colocation)
- [Set ordering](#set-ordering)
- [Set preferred location](#set-preferred-location)
- [Move resources](#move-resources)
- [Resource tracing](#resource-tracing)
- [Clear fail counts](#clear-fail-counts)
- [Edit fail counts](#edit-fail-counts)
- [Handling configuration elements by type](#handling-configuration-elements-by-type)
- [Create a clone](#create-a-clone)
- [Create a master/slave clone](#create-a-masterslave-clone)
- [Other operations](#other-operations)
- [Batch changes](#batch-changes)
- [Batch changes](#batch-changes)
- [Template creation](#template-creation)
- [Log analysis](#log-analysis)
- [Configuration scripts](#configuration-scripts)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -166,6 +174,19 @@ pcs treats STONITH devices separately.
crmsh # crm resource param ClusterIP set clusterip_hash=sourceip
pcs # pcs resource update ClusterIP clusterip_hash=sourceip

crmsh also has an `edit` command which edits the simplified CIB syntax
(same commands as the command line) via a configurable text editor.

crmsh # crm configure edit ClusterIP

Using the interactive shell mode of crmsh, multiple changes can be
edited and verified before committing to the live configuration.

crmsh # crm configure
crmsh # edit
crmsh # verify
crmsh # commit

## Delete parameters for a given resource

crmsh # crm resource param ClusterIP delete nic
Expand Down Expand Up @@ -231,16 +252,45 @@ With roles:

A resource can also be moved away from a given node:

crmsh #
crmsh # crm resource ban Website pcmk-2
pcs # pcs resource ban Website pcmk-2

Remember that moving a resource sets a stickyness to -INF to a given node until unmoved
Also, pcs deals with constraints differently. These can be manipulated by the command above as well as the following and others

crmsh #
## Resource tracing

crmsh # crm resource trace Website
pcs #

## Clear fail counts

crmsh # crm resource cleanup Website
pcs #

## Edit fail counts

crmsh # crm resource failcount Website show pcmk-1
crmsh # crm resource failcount Website set pcmk-1 100
pcs #

## Handling configuration elements by type

pcs deals with constraints differently. These can be manipulated by the command above as well as the following and others

pcs # pcs constraint list --full
pcs # pcs constraint remove cli-ban-Website-on-pcmk-1

Removing a constraint in crmsh uses the same command as removing a
resource.

crmsh # crm configure remove cli-ban-Website-on-pcmk-1

The `show` and `edit` commands in crmsh can be used to manage
resources and constraints by type:

crmsh # crm configure show type:primitive
crmsh # crm configure edit type:colocation

## Create a clone

crmsh # crm configure clone WebIP ClusterIP meta globally-unique=true clone-max=2 clone-node-max=2
Expand Down Expand Up @@ -275,3 +325,32 @@ Also, pcs deals with constraints differently. These can be manipulated by the co
pcs # pcs -f drbd_cfg resource master WebDataClone WebData master-max=1 master-node-max=1 \
clone-max=2 clone-node-max=1 notify=true
pcs # pcs cluster push cib drbd_cfg

## Template creation

Create a resource template based on a list of primitives of the same
type

crmsh # crm configure assist template ClusterIP AdminIP

## Log analysis

Display information about recent cluster events

crmsh # crm history
crmsh # peinputs
crmsh # transition pe-input-10
crmsh # transition log pe-input-10

## Configuration scripts

Create and apply multiple-step cluster configurations including
configuration of cluster resources

crmsh # crm script show apache
crmsh # crm script run apache \
id=WebSite \
install=true \
virtual-ip:ip=192.168.0.15 \
database:id=WebData \
database:install=true

0 comments on commit f08e81c

Please sign in to comment.