Using crm: Difference between revisions
No edit summary |
|||
Line 28: | Line 28: | ||
Manage shadow CIBs | Manage shadow CIBs | ||
=== new === | === cib > new === | ||
Create a new shadow CIB. | Create a new shadow CIB. | ||
Line 34: | Line 34: | ||
usage: new <shadow_cib> [withstatus] [force] [empty] | usage: new <shadow_cib> [withstatus] [force] [empty] | ||
=== delete === | === cib > delete === | ||
Delete a shadow CIB | Delete a shadow CIB | ||
Line 40: | Line 40: | ||
usage: delete <shadow_cib> | usage: delete <shadow_cib> | ||
=== reset === | === cib > reset === | ||
Copy live cib to a shadow CIB | Copy live cib to a shadow CIB | ||
Line 46: | Line 46: | ||
usage: reset <shadow_cib> | usage: reset <shadow_cib> | ||
=== commit === | === cib > commit === | ||
Copy a shadow CIB to the cluster | Copy a shadow CIB to the cluster | ||
Line 52: | Line 52: | ||
usage: commit <shadow_cib> | usage: commit <shadow_cib> | ||
=== use === | === cib > use === | ||
Change working CIB | Change working CIB | ||
=== diff === | === cib > diff === | ||
diff between the shadow CIB and the live CIB | diff between the shadow CIB and the live CIB | ||
=== list === | === cib > list === | ||
list all shadow CIBs | list all shadow CIBs | ||
=== import === | === cib > import === | ||
import a CIB or PE input file to a shadow | import a CIB or PE input file to a shadow | ||
Line 70: | Line 70: | ||
usage: import {<file>|<number>} [<shadow>] | usage: import {<file>|<number>} [<shadow>] | ||
=== cibstatus === | === cib > cibstatus === | ||
CIB status management and editing | CIB status management and editing | ||
==== load ==== | ==== cib > cibstatus > load ==== | ||
load the CIB status section | load the CIB status section | ||
Line 80: | Line 80: | ||
usage: load {<file>|shadow:<cib>|live} | usage: load {<file>|shadow:<cib>|live} | ||
==== save ==== | ==== cib > cibstatus > save ==== | ||
save the CIB status section | save the CIB status section | ||
==== origin ==== | ==== cib > cibstatus > origin ==== | ||
display origin of the CIB status section | display origin of the CIB status section | ||
==== show ==== | ==== cib > cibstatus > show ==== | ||
show CIB status section | show CIB status section | ||
Line 94: | Line 94: | ||
This shows the raw [[XML]]. | This shows the raw [[XML]]. | ||
==== node ==== | ==== cib > cibstatus > node ==== | ||
change node status | change node status | ||
Line 100: | Line 100: | ||
usage: node <node> {online|offline|unclean} | usage: node <node> {online|offline|unclean} | ||
==== op ==== | ==== cib > cibstatus > op ==== | ||
edit outcome of a resource operation | edit outcome of a resource operation | ||
Line 106: | Line 106: | ||
usage: op <operation> <resource> <exit_code> [<op_status>] [<node>] | usage: op <operation> <resource> <exit_code> [<op_status>] [<node>] | ||
==== quorum ==== | ==== cib > cibstatus > quorum ==== | ||
set the quorum | set the quorum | ||
Line 112: | Line 112: | ||
usage: quorum <bool> | usage: quorum <bool> | ||
==== run ==== | ==== cib > cibstatus > run ==== | ||
run policy engine | run policy engine | ||
Line 118: | Line 118: | ||
Also(?) displays the cluster status. | Also(?) displays the cluster status. | ||
==== simulate ==== | ==== cib > cibstatus > simulate ==== | ||
simulate cluster transition | simulate cluster transition | ||
Line 128: | Line 128: | ||
Resources management | Resources management | ||
=== status === | === resource > status === | ||
show status of resources | show status of resources | ||
=== start === | === resource > start === | ||
start a resource | start a resource | ||
Line 138: | Line 138: | ||
usage: start <rsc> | usage: start <rsc> | ||
=== stop === | === resource > stop === | ||
stop a resource | stop a resource | ||
Line 144: | Line 144: | ||
usage: stop <rsc> | usage: stop <rsc> | ||
=== restart === | === resource > restart === | ||
restart a resource | restart a resource | ||
Line 150: | Line 150: | ||
usage: restart <rsc> | usage: restart <rsc> | ||
=== promote === | === resource > promote === | ||
promote a master-slave resource | promote a master-slave resource | ||
Line 156: | Line 156: | ||
usage: promote <rsc> | usage: promote <rsc> | ||
=== demote === | === resource > demote === | ||
demote a master-slave resource | demote a master-slave resource | ||
Line 162: | Line 162: | ||
usage: demote <rsc> | usage: demote <rsc> | ||
=== manage === | === resource > manage === | ||
put a resource into managed mode | put a resource into managed mode | ||
Line 168: | Line 168: | ||
usage: manage <rsc> | usage: manage <rsc> | ||
=== unmanage === | === resource > unmanage === | ||
put a resource into unmanaged mode | put a resource into unmanaged mode | ||
Line 174: | Line 174: | ||
usage: unmanage <rsc> | usage: unmanage <rsc> | ||
=== migrate === | === resource > migrate === | ||
migrate a resource to another node | migrate a resource to another node | ||
Line 180: | Line 180: | ||
usage: migrate <rsc> [<node>] [<lifetime>] [force] | usage: migrate <rsc> [<node>] [<lifetime>] [force] | ||
=== unmigrate === | === resource > unmigrate === | ||
unmigrate a resource to another node | unmigrate a resource to another node | ||
Line 186: | Line 186: | ||
usage: unmigrate <rsc> | usage: unmigrate <rsc> | ||
=== param === | === resource > param === | ||
manage a parameter of a resource | manage a parameter of a resource | ||
Line 197: | Line 197: | ||
</source> | </source> | ||
=== meta === | === resource > meta === | ||
manage a meta attribute | manage a meta attribute | ||
Line 208: | Line 208: | ||
</source> | </source> | ||
=== utilization === | === resource > utilization === | ||
manage a utilization attribute | manage a utilization attribute | ||
Line 219: | Line 219: | ||
</source> | </source> | ||
=== failcount === | === resource > failcount === | ||
manage failcounts | manage failcounts | ||
Line 230: | Line 230: | ||
</source> | </source> | ||
=== cleanup === | === resource > cleanup === | ||
cleanup resource status | cleanup resource status | ||
Line 236: | Line 236: | ||
usage: cleanup <rsc> [<node>] | usage: cleanup <rsc> [<node>] | ||
=== refresh === | === resource > refresh === | ||
refresh CIB from the LRM status | refresh CIB from the LRM status | ||
=== reprobe === | === resource > reprobe === | ||
probe for resources not started by the CRM | probe for resources not started by the CRM | ||
Line 248: | Line 248: | ||
CRM cluster configuration | CRM cluster configuration | ||
=== node === | === configure > node === | ||
define a cluster node | define a cluster node | ||
Line 258: | Line 258: | ||
</source> | </source> | ||
=== primitive === | === configure > primitive === | ||
define a resource | define a resource | ||
Line 271: | Line 271: | ||
</source> | </source> | ||
=== monitor === | === configure > monitor === | ||
add monitor operation to a primitive | add monitor operation to a primitive | ||
Line 279: | Line 279: | ||
</source> | </source> | ||
=== group === | === configure > group === | ||
define a group | define a group | ||
Line 289: | Line 289: | ||
</source> | </source> | ||
=== clone === | === configure > clone === | ||
define a clone | define a clone | ||
Line 299: | Line 299: | ||
</source> | </source> | ||
=== ms === | === configure > ms === | ||
define a master-slave resource | define a master-slave resource | ||
Line 309: | Line 309: | ||
</source> | </source> | ||
=== location === | === configure > location === | ||
a location preference | a location preference | ||
Line 334: | Line 334: | ||
</source> | </source> | ||
=== colocation === | === configure > colocation === | ||
colocate resources | colocate resources | ||
Line 342: | Line 342: | ||
</source> | </source> | ||
=== order === | === configure > order === | ||
order resources | order resources | ||
Line 351: | Line 351: | ||
</source> | </source> | ||
=== property === | === configure > property === | ||
set a cluster property | set a cluster property | ||
Line 359: | Line 359: | ||
</source> | </source> | ||
=== rsc_defaults === | === configure > rsc_defaults === | ||
set resource defaults | set resource defaults | ||
Line 367: | Line 367: | ||
</source> | </source> | ||
=== role === | === configure > role === | ||
define role access rights | define role access rights | ||
Line 393: | Line 393: | ||
</source> | </source> | ||
=== user === | === configure > user === | ||
define user access rights | define user access rights | ||
Line 406: | Line 406: | ||
</source> | </source> | ||
=== op_defaults === | === configure > op_defaults === | ||
set resource operations defaults | set resource operations defaults | ||
Line 414: | Line 414: | ||
</source> | </source> | ||
=== show === | === configure > show === | ||
display CIB objects | display CIB objects | ||
Line 420: | Line 420: | ||
Shows the current cluster configuration. | Shows the current cluster configuration. | ||
=== edit === | === configure > edit === | ||
edit CIB objects | edit CIB objects | ||
Line 426: | Line 426: | ||
This opens an editor (vim?) with the current CIB objects. | This opens an editor (vim?) with the current CIB objects. | ||
=== filter === | === configure > filter === | ||
filter CIB objects | filter CIB objects | ||
Line 434: | Line 434: | ||
</source> | </source> | ||
=== delete === | === configure > delete === | ||
delete CIB objects | delete CIB objects | ||
Line 442: | Line 442: | ||
</source> | </source> | ||
=== default-timeouts === | === configure > default-timeouts === | ||
set timeouts for operations to minimums from the meta-data | set timeouts for operations to minimums from the meta-data | ||
Line 450: | Line 450: | ||
</source> | </source> | ||
=== rename === | === configure > rename === | ||
rename a CIB object | rename a CIB object | ||
Line 458: | Line 458: | ||
</source> | </source> | ||
=== refresh === | === configure > refresh === | ||
refresh from CIB | refresh from CIB | ||
Line 464: | Line 464: | ||
This will reload the old CIB, causing any uncommitted changes to be lost. | This will reload the old CIB, causing any uncommitted changes to be lost. | ||
=== erase === | === configure > erase === | ||
erase the CIB | erase the CIB | ||
Line 470: | Line 470: | ||
This wipes out all CIB objects, leaving only the bare node definitions. If used accidentally, use <span class="code">refresh</span> to restore the current CIB configuration. | This wipes out all CIB objects, leaving only the bare node definitions. If used accidentally, use <span class="code">refresh</span> to restore the current CIB configuration. | ||
=== ptest === | === configure > ptest === | ||
show cluster actions if changes were committed | show cluster actions if changes were committed | ||
Line 476: | Line 476: | ||
INFO: install graphviz to see a transition graph | INFO: install graphviz to see a transition graph | ||
=== cib === | === configure > cib === | ||
Same menu as [[#cib]] off the root of the shell. | Same menu as [[#cib|cib]] off the root of the shell. | ||
=== cibstatus === | === configure > cibstatus === | ||
Same menu as [[#cib > cibstatus]] | Same menu as [[#cib_.3E_cibstatus|cib > cibstatus]]. | ||
=== template === | === configure > template === | ||
edit and import a configuration from a template | edit and import a configuration from a template | ||
=== commit === | ==== configure > template > new ==== | ||
create a new configuration from templates | |||
<source lang="text"> | |||
usage: new <config> <template> [<template> ...] [params name=value ...] | |||
</source> | |||
==== configure > template > load ==== | |||
load a configuration | |||
==== configure > template > edit ==== | |||
edit a configuration | |||
==== configure > template > delete ==== | |||
delete a configuration | |||
<source lang="text"> | |||
usage: delete <config> [force] | |||
</source> | |||
==== configure > template > list ==== | |||
list configurations/templates | |||
==== configure > template > apply ==== | |||
process and apply the current configuration to the current CIB | |||
==== configure > template > show ==== | |||
show the processed configuration | |||
=== configure > commit === | |||
commit the changes to the CIB | commit the changes to the CIB | ||
=== verify === | === configure > verify === | ||
verify the CIB with crm_verify | verify the CIB with crm_verify | ||
=== upgrade === | === configure > upgrade === | ||
upgrade the CIB to version 1.0 | upgrade the CIB to version 1.0 | ||
=== save === | === configure > save === | ||
save the CIB to a file | save the CIB to a file | ||
=== load === | === configure > load === | ||
import the CIB from a file | import the CIB from a file | ||
=== xml === | === configure > xml === | ||
raw xml | raw xml |
Revision as of 06:22, 10 July 2011
This aims to be a complete guide to using Pacemaker's crm cluster resource manager tool.
crm
The crm command is the main method of invoking the cluster resource manager.
- Called without arguments, it invokes the crm shell.
- Called with arguments, it acts as a "one-shot" operation, executing all commands following it.
- Called with crm -f /path/to/file, it will read the file and execute all commands found within.
- Called with crm -, STDIN is read for arguments.
The crm Shell
The crm shell acts as an interactive shell, allowing for the cluster to be manipulated in real-time.
All commands can be entered in a hierarchical manner. Simply enter a command and press <enter> to decent into that sub-command's menu. To return, type end, cd or up.
At any level, you can type help to get a list of arguments that are valid at the given level you are in.
At any time, you can type quit, bye or exit to leave the shell.
All commands listed in the rest of this document can be entered at the command line as a "one-shot" command. Likewise, a combination of command sequences can be saved in a file and the read into crm.
cib
Manage shadow CIBs
cib > new
Create a new shadow CIB.
usage: new <shadow_cib> [withstatus] [force] [empty]
cib > delete
Delete a shadow CIB
usage: delete <shadow_cib>
cib > reset
Copy live cib to a shadow CIB
usage: reset <shadow_cib>
cib > commit
Copy a shadow CIB to the cluster
usage: commit <shadow_cib>
cib > use
Change working CIB
cib > diff
diff between the shadow CIB and the live CIB
cib > list
list all shadow CIBs
cib > import
import a CIB or PE input file to a shadow
usage: import {<file>|<number>} [<shadow>]
cib > cibstatus
CIB status management and editing
cib > cibstatus > load
load the CIB status section
usage: load {<file>|shadow:<cib>|live}
cib > cibstatus > save
save the CIB status section
cib > cibstatus > origin
display origin of the CIB status section
cib > cibstatus > show
show CIB status section
This shows the raw XML.
cib > cibstatus > node
change node status
usage: node <node> {online|offline|unclean}
cib > cibstatus > op
edit outcome of a resource operation
usage: op <operation> <resource> <exit_code> [<op_status>] [<node>]
cib > cibstatus > quorum
set the quorum
usage: quorum <bool>
cib > cibstatus > run
run policy engine
Also(?) displays the cluster status.
cib > cibstatus > simulate
simulate cluster transition
Also(?) displays the cluster status.
resource
Resources management
resource > status
show status of resources
resource > start
start a resource
usage: start <rsc>
resource > stop
stop a resource
usage: stop <rsc>
resource > restart
restart a resource
usage: restart <rsc>
resource > promote
promote a master-slave resource
usage: promote <rsc>
resource > demote
demote a master-slave resource
usage: demote <rsc>
resource > manage
put a resource into managed mode
usage: manage <rsc>
resource > unmanage
put a resource into unmanaged mode
usage: unmanage <rsc>
resource > migrate
migrate a resource to another node
usage: migrate <rsc> [<node>] [<lifetime>] [force]
resource > unmigrate
unmigrate a resource to another node
usage: unmigrate <rsc>
resource > param
manage a parameter of a resource
usage:
param <rsc> set <param> <value>
param <rsc> delete <param>
param <rsc> show <param>
resource > meta
manage a meta attribute
usage:
meta <rsc> set <attr> <value>
meta <rsc> delete <attr>
meta <rsc> show <attr>
resource > utilization
manage a utilization attribute
usage:
utilization <rsc> set <attr> <value>
utilization <rsc> delete <attr>
utilization <rsc> show <attr>
resource > failcount
manage failcounts
usage:
failcount <rsc> set <node> <value>
failcount <rsc> delete <node>
failcount <rsc> show <node>
resource > cleanup
cleanup resource status
usage: cleanup <rsc> [<node>]
resource > refresh
refresh CIB from the LRM status
resource > reprobe
probe for resources not started by the CRM
configure
CRM cluster configuration
configure > node
define a cluster node
usage: node <uname>[:<type>]
[attributes <param>=<value> [<param>=<value>...]]
[utilization <param>=<value> [<param>=<value>...]]
configure > primitive
define a resource
usage: primitive <rsc> [<class>:[<provider>:]]<type>
[params <param>=<value> [<param>=<value>...]]
[meta <attribute>=<value> [<attribute>=<value>...]]
[utilization <attribute>=<value> [<attribute>=<value>...]]
[operations id_spec
[op op_type [<attribute>=<value>...] ...]]
configure > monitor
add monitor operation to a primitive
usage: monitor <rsc>[:<role>] <interval>[:<timeout>]
configure > group
define a group
usage: group <name> <rsc> [<rsc>...]
[params <param>=<value> [<param>=<value>...]]
[meta <attribute>=<value> [<attribute>=<value>...]]
configure > clone
define a clone
usage: clone <name> <rsc>
[params <param>=<value> [<param>=<value>...]]
[meta <attribute>=<value> [<attribute>=<value>...]]
configure > ms
define a master-slave resource
usage: ms <name> <rsc>
[params <param>=<value> [<param>=<value>...]]
[meta <attribute>=<value> [<attribute>=<value>...]]
configure > location
a location preference
usage: location <id> <rsc> {node_pref|rules}
node_pref :: <score>: <node>
rules ::
rule [id_spec] [$role=<role>] <score>: <expression>
[rule [id_spec] [$role=<role>] <score>: <expression> ...]
id_spec :: $id=<id> | $id-ref=<id>
score :: <number> | <attribute> | [-]inf
expression :: <simple_exp> [bool_op <simple_exp> ...]
bool_op :: or | and
simple_exp :: <attribute> [type:]<binary_op> <value>
| <unary_op> <attribute>
| date <date_expr>
type :: string | version | number
binary_op :: lt | gt | lte | gte | eq | ne
unary_op :: defined | not_defined
configure > colocation
colocate resources
usage: colocation <id> <score>: <rsc>[:<role>] <rsc>[:<role>]
configure > order
order resources
usage: order <id> score-type: <first-rsc>[:<action>] <then-rsc>[:<action>]
[symmetrical=<bool>]
configure > property
set a cluster property
usage: property [$id=<set_id>] <option>=<value>
configure > rsc_defaults
set resource defaults
usage: rsc_defaults [$id=<set_id>] <option>=<value>
configure > role
define role access rights
role <role-id> rule [rule ...]
rule :: acl-right cib-spec [attribute:<attribute>]
acl-right :: read | write | deny
cib-spec :: xpath-spec | tag-ref-spec
xpath-spec :: xpath:<xpath> | shortcut
tag-ref-spec :: tag:<tag> | ref:<id> | tag:<tag> ref:<id>
shortcut :: meta:<rsc>[:<attr>]
params:<rsc>[:<attr>]
utilization:<rsc>
location:<rsc>
property[:<attr>]
node[:<node>]
nodeattr[:<attr>]
nodeutil[:<node>]
status
configure > user
define user access rights
user <uid> {roles|rules}
roles :: role:<role-ref> [role:<role-ref> ...]
rules :: rule [rule ...]
(See the role command for details on rules.)
configure > op_defaults
set resource operations defaults
usage: op_defaults [$id=<set_id>] <option>=<value>
configure > show
display CIB objects
Shows the current cluster configuration.
configure > edit
edit CIB objects
This opens an editor (vim?) with the current CIB objects.
configure > filter
filter CIB objects
usage: filter <prog> [xml] [<id>...]
configure > delete
delete CIB objects
usage: delete <id> [<id>...]
configure > default-timeouts
set timeouts for operations to minimums from the meta-data
usage: default-timeouts <id> [<id>...]
configure > rename
rename a CIB object
usage: rename <old_id> <new_id>
configure > refresh
refresh from CIB
This will reload the old CIB, causing any uncommitted changes to be lost.
configure > erase
erase the CIB
This wipes out all CIB objects, leaving only the bare node definitions. If used accidentally, use refresh to restore the current CIB configuration.
configure > ptest
show cluster actions if changes were committed
INFO: install graphviz to see a transition graph
configure > cib
Same menu as cib off the root of the shell.
configure > cibstatus
Same menu as cib > cibstatus.
configure > template
edit and import a configuration from a template
configure > template > new
create a new configuration from templates
usage: new <config> <template> [<template> ...] [params name=value ...]
configure > template > load
load a configuration
configure > template > edit
edit a configuration
configure > template > delete
delete a configuration
usage: delete <config> [force]
configure > template > list
list configurations/templates
configure > template > apply
process and apply the current configuration to the current CIB
configure > template > show
show the processed configuration
configure > commit
commit the changes to the CIB
configure > verify
verify the CIB with crm_verify
configure > upgrade
upgrade the CIB to version 1.0
configure > save
save the CIB to a file
configure > load
import the CIB from a file
configure > xml
raw xml
node
Nodes management
options
User preferences
ra
Resource agents information center
status
Show cluster status
Any questions, feedback, advice, complaints or meanderings are welcome. | |||
Alteeve's Niche! | Enterprise Support: Alteeve Support |
Community Support | |
© Alteeve's Niche! Inc. 1997-2024 | Anvil! "Intelligent Availability®" Platform | ||
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions. |