|
rpm-build |
3ee90c |
:compat-mode: legacy
|
|
rpm-build |
3ee90c |
= Configuring Pacemaker =
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Pacemaker's configuration, the CIB, is stored in XML format. Cluster
|
|
rpm-build |
3ee90c |
administrators have multiple options for modifying the configuration either via
|
|
rpm-build |
3ee90c |
the XML, or at a more abstract (and easier for humans to understand) level.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Pacemaker reacts to configuration changes as soon as they are saved.
|
|
rpm-build |
3ee90c |
Pacemaker's command-line tools and most higher-level tools provide the ability
|
|
rpm-build |
3ee90c |
to batch changes together and commit them at once, rather than make a series of
|
|
rpm-build |
3ee90c |
small changes, which could cause avoid unnecessary actions as Pacemaker
|
|
rpm-build |
3ee90c |
responds to each change individually.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Pacemaker tracks revisions to the configuration and will reject any update
|
|
rpm-build |
3ee90c |
older than the current revision. Thus, it is a good idea to serialize all
|
|
rpm-build |
3ee90c |
changes to the configuration. Avoid attempting simultaneous changes, whether on
|
|
rpm-build |
3ee90c |
the same node or different nodes, and whether manually or using some automated
|
|
rpm-build |
3ee90c |
configuration tool.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
[NOTE]
|
|
rpm-build |
3ee90c |
====
|
|
rpm-build |
3ee90c |
It is not necessary to update the configuration on all cluster nodes. Pacemaker
|
|
rpm-build |
3ee90c |
immediately synchronizes changes to all active members of the cluster. To
|
|
rpm-build |
3ee90c |
reduce bandwidth, the cluster only broadcasts the incremental updates that
|
|
rpm-build |
3ee90c |
result from your changes and uses checksums to ensure that each copy is
|
|
rpm-build |
3ee90c |
consistent.
|
|
rpm-build |
3ee90c |
====
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
=== Configuration Using Higher-level Tools ===
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Most users will benefit from using higher-level tools provided by
|
|
rpm-build |
3ee90c |
projects separate from Pacemaker. Some of the most commonly used include the
|
|
rpm-build |
3ee90c |
crm shell, hawk, and pcs. footnote:[For a list, see "Configuration Tools" at
|
|
rpm-build |
3ee90c |
https://clusterlabs.org/components.html]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
See those projects' documentation for details on how to configure Pacemaker
|
|
rpm-build |
3ee90c |
using them.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
=== Configuration Using Pacemaker's Command-Line Tools ===
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Pacemaker provides lower-level, command-line tools to manage the cluster. Most
|
|
rpm-build |
3ee90c |
configuration tasks can be performed with these tools, without needing any XML
|
|
rpm-build |
3ee90c |
knowledge.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
To enable STONITH for example, one could run:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# crm_attribute --name stonith-enabled --update 1
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Or, to check whether *node1* is allowed to run resources, there is:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# crm_standby --query --node node1
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Or, to change the failure threshold of *my-test-rsc*, one can use:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# crm_resource -r my-test-rsc --set-parameter migration-threshold --parameter-value 3 --meta
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Examples of using these tools for specific cases will be given throughout this
|
|
rpm-build |
3ee90c |
document where appropriate. See the man pages for further details.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
See <<s-cibadmin>> for how to edit the CIB using XML.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
See <<s-crm_shadow>> for a way to make a series of changes, then commit them
|
|
rpm-build |
3ee90c |
all at once to the live cluster.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
== Working with CIB Properties ==
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Although these fields can be written to by the user, in
|
|
rpm-build |
3ee90c |
most cases the cluster will overwrite any values specified by the
|
|
rpm-build |
3ee90c |
user with the "correct" ones.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
To change the ones that can be specified by the user,
|
|
rpm-build |
3ee90c |
for example +admin_epoch+, one should use:
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# cibadmin --modify --xml-text '<cib admin_epoch="42"/>'
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
A complete set of CIB properties will look something like this:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
.XML attributes set for a cib element
|
|
rpm-build |
3ee90c |
======
|
|
rpm-build |
3ee90c |
[source,XML]
|
|
rpm-build |
3ee90c |
-------
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
admin_epoch="42" epoch="116" num_updates="1"
|
|
rpm-build |
3ee90c |
cib-last-written="Mon Jan 12 15:46:39 2015" update-origin="rhel7-1"
|
|
rpm-build |
3ee90c |
update-client="crm_attribute" have-quorum="1" dc-uuid="1">
|
|
rpm-build |
3ee90c |
-------
|
|
rpm-build |
3ee90c |
======
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
== Querying and Setting Cluster Options ==
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
indexterm:[Querying,Cluster Option]
|
|
rpm-build |
3ee90c |
indexterm:[Setting,Cluster Option]
|
|
rpm-build |
3ee90c |
indexterm:[Cluster,Querying Options]
|
|
rpm-build |
3ee90c |
indexterm:[Cluster,Setting Options]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Cluster options can be queried and modified using the `crm_attribute` tool. To
|
|
rpm-build |
3ee90c |
get the current value of +cluster-delay+, you can run:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# crm_attribute --query --name cluster-delay
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
which is more simply written as
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# crm_attribute -G -n cluster-delay
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
If a value is found, you'll see a result like this:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# crm_attribute -G -n cluster-delay
|
|
rpm-build |
3ee90c |
scope=crm_config name=cluster-delay value=60s
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
If no value is found, the tool will display an error:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# crm_attribute -G -n clusta-deway
|
|
rpm-build |
3ee90c |
scope=crm_config name=clusta-deway value=(null)
|
|
rpm-build |
3ee90c |
Error performing operation: No such device or address
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
To use a different value (for example, 30 seconds), simply run:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# crm_attribute --name cluster-delay --update 30s
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
To go back to the cluster's default value, you can delete the value, for example:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# crm_attribute --name cluster-delay --delete
|
|
rpm-build |
3ee90c |
Deleted crm_config option: id=cib-bootstrap-options-cluster-delay name=cluster-delay
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
=== When Options are Listed More Than Once ===
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
If you ever see something like the following, it means that the option you're modifying is present more than once.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
.Deleting an option that is listed twice
|
|
rpm-build |
3ee90c |
=======
|
|
rpm-build |
3ee90c |
------
|
|
rpm-build |
3ee90c |
# crm_attribute --name batch-limit --delete
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Multiple attributes match name=batch-limit in crm_config:
|
|
rpm-build |
3ee90c |
Value: 50 (set=cib-bootstrap-options, id=cib-bootstrap-options-batch-limit)
|
|
rpm-build |
3ee90c |
Value: 100 (set=custom, id=custom-batch-limit)
|
|
rpm-build |
3ee90c |
Please choose from one of the matches above and supply the 'id' with --id
|
|
rpm-build |
3ee90c |
-------
|
|
rpm-build |
3ee90c |
=======
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
In such cases, follow the on-screen instructions to perform the
|
|
rpm-build |
3ee90c |
requested action. To determine which value is currently being used by
|
|
rpm-build |
3ee90c |
the cluster, refer to the 'Rules' chapter of 'Pacemaker Explained'.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
[[s-remote-connection]]
|
|
rpm-build |
3ee90c |
== Connecting from a Remote Machine ==
|
|
rpm-build |
3ee90c |
indexterm:[Cluster,Remote connection]
|
|
rpm-build |
3ee90c |
indexterm:[Cluster,Remote administration]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
Provided Pacemaker is installed on a machine, it is possible to
|
|
rpm-build |
3ee90c |
connect to the cluster even if the machine itself is not in the same
|
|
rpm-build |
3ee90c |
cluster. To do this, one simply sets up a number of environment
|
|
rpm-build |
3ee90c |
variables and runs the same commands as when working on a cluster
|
|
rpm-build |
3ee90c |
node.
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
.Environment Variables Used to Connect to Remote Instances of the CIB
|
|
rpm-build |
3ee90c |
[width="95%",cols="1m,1,<3",options="header",align="center"]
|
|
rpm-build |
3ee90c |
|=========================================================
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|Environment Variable
|
|
rpm-build |
3ee90c |
|Default
|
|
rpm-build |
3ee90c |
|Description
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|CIB_user
|
|
rpm-build |
3ee90c |
|$USER
|
|
rpm-build |
3ee90c |
|The user to connect as. Needs to be part of the +haclient+ group on
|
|
rpm-build |
3ee90c |
the target host.
|
|
rpm-build |
3ee90c |
indexterm:[Environment Variable,CIB_user]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|CIB_passwd
|
|
rpm-build |
3ee90c |
|
|
|
rpm-build |
3ee90c |
|The user's password. Read from the command line if unset.
|
|
rpm-build |
3ee90c |
indexterm:[Environment Variable,CIB_passwd]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|CIB_server
|
|
rpm-build |
3ee90c |
|localhost
|
|
rpm-build |
3ee90c |
|The host to contact
|
|
rpm-build |
3ee90c |
indexterm:[Environment Variable,CIB_server]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|CIB_port
|
|
rpm-build |
3ee90c |
|
|
|
rpm-build |
3ee90c |
|The port on which to contact the server; required.
|
|
rpm-build |
3ee90c |
indexterm:[Environment Variable,CIB_port]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|CIB_encrypted
|
|
rpm-build |
3ee90c |
|TRUE
|
|
rpm-build |
3ee90c |
|Whether to encrypt network traffic
|
|
rpm-build |
3ee90c |
indexterm:[Environment Variable,CIB_encrypted]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|=========================================================
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
So, if *c001n01* is an active cluster node and is listening on port 1234
|
|
rpm-build |
3ee90c |
for connections, and *someuser* is a member of the *haclient* group,
|
|
rpm-build |
3ee90c |
then the following would prompt for *someuser*'s password and return
|
|
rpm-build |
3ee90c |
the cluster's current configuration:
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
# export CIB_port=1234; export CIB_server=c001n01; export CIB_user=someuser;
|
|
rpm-build |
3ee90c |
# cibadmin -Q
|
|
rpm-build |
3ee90c |
----
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
For security reasons, the cluster does not listen for remote
|
|
rpm-build |
3ee90c |
connections by default. If you wish to allow remote access, you need
|
|
rpm-build |
3ee90c |
to set the +remote-tls-port+ (encrypted) or +remote-clear-port+
|
|
rpm-build |
3ee90c |
(unencrypted) CIB properties (i.e., those kept in the +cib+ tag, like
|
|
rpm-build |
3ee90c |
+num_updates+ and +epoch+).
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
.Extra top-level CIB properties for remote access
|
|
rpm-build |
3ee90c |
[width="95%",cols="1m,1,<3",options="header",align="center"]
|
|
rpm-build |
3ee90c |
|=========================================================
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|Field
|
|
rpm-build |
3ee90c |
|Default
|
|
rpm-build |
3ee90c |
|Description
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|remote-tls-port
|
|
rpm-build |
3ee90c |
|_none_
|
|
rpm-build |
3ee90c |
|Listen for encrypted remote connections on this port.
|
|
rpm-build |
3ee90c |
indexterm:[remote-tls-port,Remote Connection Option]
|
|
rpm-build |
3ee90c |
indexterm:[Remote Connection,Option,remote-tls-port]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|remote-clear-port
|
|
rpm-build |
3ee90c |
|_none_
|
|
rpm-build |
3ee90c |
|Listen for plaintext remote connections on this port.
|
|
rpm-build |
3ee90c |
indexterm:[remote-clear-port,Remote Connection Option]
|
|
rpm-build |
3ee90c |
indexterm:[Remote Connection,Option,remote-clear-port]
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
|=========================================================
|
|
rpm-build |
3ee90c |
|
|
rpm-build |
3ee90c |
[IMPORTANT]
|
|
rpm-build |
3ee90c |
====
|
|
rpm-build |
3ee90c |
The Pacemaker version on the administration host must be the same or greater
|
|
rpm-build |
3ee90c |
than the version(s) on the cluster nodes. Otherwise, it may not have the schema
|
|
rpm-build |
3ee90c |
files necessary to validate the CIB.
|
|
rpm-build |
3ee90c |
====
|