PCS(8) | System Administration Utilities | PCS(8) |
pcs - pacemaker/corosync configuration system
pcs [-f file] [-h] [commands]...
Control and configure pacemaker and corosync.
Example: Create a new resource called 'VirtualIP' with IP address 192.168.0.99, netmask of 32, monitored everything 30 seconds, on eth2: pcs resource create VirtualIP ocf:heartbeat:IPaddr2 ip=192.168.0.99 cidr_netmask=32 nic=eth2 op monitor interval=30s
Transport knet:
This is the default transport. It allows configuring traffic encryption
and compression as well as using multiple addresses (links) for nodes.
Transport options are: ip_version, knet_pmtud_interval, link_mode
Link options are: ip_version, link_priority, linknumber, mcastport,
ping_interval, ping_precision, ping_timeout, pong_count, transport (udp
or sctp)
Compression options are: level, model, threshold
Crypto options are: cipher, hash, model
By default, encryption is enabled with cipher=aes256 and hash=sha256. To
disable encryption, set cipher=none and hash=none.
Transports udp and udpu:
These transports are limited to one address per node. They do not support
traffic encryption nor compression.
Transport options are: ip_version, netmtu
Link options are: bindnetaddr, broadcast, mcastaddr, mcastport, ttl
Totem and quorum can be configured regardles of used
transport.
Totem options are: consensus, downcheck, fail_recv_const,
heartbeat_failures_allowed, hold, join, max_messages, max_network_delay,
merge, miss_count_const, send_join, seqno_unchanged_const, token,
token_coefficient, token_retransmit,
token_retransmits_before_loss_const, window_size
Quorum options are: auto_tie_breaker, last_man_standing,
last_man_standing_window, wait_for_all
Transports and their options, link, compression, crypto and totem options are all documented in corosync.conf(5) man page; knet link options are prefixed 'knet_' there, compression options are prefixed 'knet_compression_' and crypto options are prefixed 'crypto_'. Quorum options are documented in votequorum(5) man page.
--enable will configure the cluster to start on nodes boot. --start will start the cluster right after creating it. --wait will wait up to 'n' seconds for the cluster to start. --no-keys-sync will skip creating and distributing pcsd SSL certificate and key and corosync and pacemaker authkey files. Use this if you provide your own certificates and keys.
Examples:
Create a cluster with default settings:
pcs cluster setup newcluster node1 node2
Create a cluster using two links:
pcs cluster setup newcluster node1 addr=10.0.1.11 addr=10.0.2.11 node2
addr=10.0.1.12 addr=10.0.2.12
Create a cluster using udp transport with a non-default port:
pcs cluster setup newcluster node1 node2 transport udp link
mcastport=55405
Example:
pcs cluster cib > original.xml
cp original.xml new.xml
pcs -f new.xml constraint location apache prefers node2
pcs cluster cib-push new.xml diff-against=original.xml
The new node is specified by its name and optionally its addresses. If no addresses are specified for the node, pcs will configure corosync to communicate with the node using an address provided in 'pcs host auth' command. Otherwise, pcs will configure corosync to communicate with the node using the specified addresses.
Use 'watchdog' to specify a path to a watchdog on the new node, when SBD is enabled in the cluster. If SBD is configured with shared storage, use 'device' to specify path to shared device(s) on the new node.
If --start is specified also start cluster on the new node, if --wait is specified wait up to 'n' seconds for the new node to start. If --enable is specified configure cluster to start on the new node on boot. If --no-watchdog-validation is specified, validation of watchdog will be skipped.
WARNING: By default, it is tested whether the specified watchdog is supported. This may cause a restart of the system when a watchdog with no-way-out-feature enabled is present. Use --no-watchdog-validation to skip watchdog validation.
WARNING: This command permanently removes any cluster configuration that has been created. It is recommended to run 'pcs cluster stop' before destroying the cluster.
Example: Create a device for nodes node1 and node2
pcs stonith create MyFence fence_virt pcmk_host_list=node1,node2
Example: Use port p1 for node n1 and ports p2 and p3 for node n2
pcs stonith create MyFence fence_virt 'pcmk_host_map=n1:p1;n2:p2,p3'
WARNING: If this node is not actually powered off or it does have access to shared resources, data corruption/cluster failure can occur. To prevent accidental running of this command, --force or interactive user response is required in order to proceed.
NOTE: It is not checked if the specified node exists in the cluster in order to be able to work with nodes not visible from the local cluster partition.
WARNING: Cluster has to be restarted in order to apply these changes.
WARNING: By default, it is tested whether the specified watchdog is supported. This may cause a restart of the system when a watchdog with no-way-out-feature enabled is present. Use --no-watchdog-validation to skip watchdog validation.
Example of enabling SBD in cluster with watchdogs on node1 will be /dev/watchdog2, on node2 /dev/watchdog1, /dev/watchdog0 on all other nodes, device /dev/sdb on node1, device /dev/sda on all other nodes and watchdog timeout will bet set to 10 seconds:
pcs stonith sbd enable watchdog=/dev/watchdog2@node1 watchdog=/dev/watchdog1@node2 watchdog=/dev/watchdog0 device=/dev/sdb@node1 device=/dev/sda SBD_WATCHDOG_TIMEOUT=10
WARNING: Cluster has to be restarted in order to apply these changes.
WARNING: All content on device(s) will be overwritten.
WARNING: Listing available watchdogs may cause a restart of the system when a watchdog with no-way-out-feature enabled is present.
WARNING: If you want to change "host" option of qdevice model net, use "pcs quorum device remove" and "pcs quorum device add" commands to set up configuration properly unless old and new host is the same machine.
WARNING: If the nodes are not actually powered off or they do have access to shared resources, data corruption/cluster failure can occur. To prevent accidental running of this command, --force or interactive user response is required in order to proceed.
Various pcs commands accept the --force option. Its purpose is to override some of checks that pcs is doing or some of errors that may occur when a pcs command is run. When such error occurs, pcs will print the error with a note it may be overridden. The exact behavior of the option is different for each pcs command. Using the --force option can lead into situations that would normally be prevented by logic of pcs commands and therefore its use is strongly discouraged unless you know what you are doing.
http://clusterlabs.org/doc/
corosync_overview(8), votequorum(5), corosync.conf(5), corosync-qdevice(8), corosync-qdevice-tool(8), corosync-qnetd(8), corosync-qnetd-tool(8)
pacemaker-controld(7), pacemaker-fenced(7), pacemaker-schedulerd(7), crm_mon(8), crm_report(8), crm_simulate(8)
November 2018 | pcs 0.10.1 |