dhodovsk / source-git / pacemaker

Forked from source-git/pacemaker 3 years ago
Clone
Blob Blame History Raw
# 
# AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 0\n"
"POT-Creation-Date: 2018-05-14 18:03-0500\n"
"PO-Revision-Date: 2018-05-14 18:03-0500\n"
"Last-Translator: Automatically generated\n"
"Language-Team: None\n"
"MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. Tag: title
#, no-c-format
msgid "Create an Active/Passive Cluster"
msgstr ""

#. Tag: title
#, no-c-format
msgid "Explore the Existing Configuration"
msgstr ""

#. Tag: para
#, no-c-format
msgid "When Pacemaker starts up, it automatically records the number and details of the nodes in the cluster, as well as which stack is being used and the version of Pacemaker being used."
msgstr ""

#. Tag: para
#, no-c-format
msgid "The first few lines of output should look like this:"
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs status\n"
"Cluster name: mycluster\n"
"WARNING: no stonith devices and stonith-enabled is not false\n"
"Stack: corosync\n"
"Current DC: pcmk-2 (version 1.1.16-12.el7_4.5-94ff4df) - partition with quorum\n"
"Last updated: Fri Jan 12 16:15:29 2018\n"
"Last change: Fri Jan 12 15:49:47 2018\n"
"\n"
"2 nodes configured\n"
"0 resources configured\n"
"\n"
"Online: [ pcmk-1 pcmk-2 ]"
msgstr ""

#. Tag: para
#, no-c-format
msgid "For those who are not of afraid of XML, you can see the raw cluster configuration and status by using the <literal>pcs cluster cib</literal> command."
msgstr ""

#. Tag: title
#, no-c-format
msgid "The last XML you’ll see in this document"
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs cluster cib"
msgstr ""

#. Tag: programlisting
#, no-c-format
msgid "&lt;cib crm_feature_set=\"3.0.12\" validate-with=\"pacemaker-2.8\" epoch=\"5\" num_updates=\"8\" admin_epoch=\"0\" cib-last-written=\"Fri Jan 12 15:49:47 2018\" have-quorum=\"1\" dc-uuid=\"2\"&gt;\n"
"  &lt;configuration&gt;\n"
"    &lt;crm_config&gt;\n"
"      &lt;cluster_property_set id=\"cib-bootstrap-options\"&gt;\n"
"        &lt;nvpair id=\"cib-bootstrap-options-have-watchdog\" name=\"have-watchdog\" value=\"false\"/&gt;\n"
"        &lt;nvpair id=\"cib-bootstrap-options-dc-version\" name=\"dc-version\" value=\"1.1.16-12.el7_4.5-94ff4df\"/&gt;\n"
"        &lt;nvpair id=\"cib-bootstrap-options-cluster-infrastructure\" name=\"cluster-infrastructure\" value=\"corosync\"/&gt;\n"
"        &lt;nvpair id=\"cib-bootstrap-options-cluster-name\" name=\"cluster-name\" value=\"mycluster\"/&gt;\n"
"      &lt;/cluster_property_set&gt;\n"
"    &lt;/crm_config&gt;\n"
"    &lt;nodes&gt;\n"
"      &lt;node id=\"1\" uname=\"pcmk-1\"/&gt;\n"
"      &lt;node id=\"2\" uname=\"pcmk-2\"/&gt;\n"
"    &lt;/nodes&gt;\n"
"    &lt;resources/&gt;\n"
"    &lt;constraints/&gt;\n"
"  &lt;/configuration&gt;\n"
"  &lt;status&gt;\n"
"    &lt;node_state id=\"2\" uname=\"pcmk-2\" in_ccm=\"true\" crmd=\"online\" crm-debug-origin=\"do_state_transition\" join=\"member\" expected=\"member\"&gt;\n"
"      &lt;lrm id=\"2\"&gt;\n"
"        &lt;lrm_resources/&gt;\n"
"      &lt;/lrm&gt;\n"
"      &lt;transient_attributes id=\"2\"&gt;\n"
"        &lt;instance_attributes id=\"status-2\"&gt;\n"
"          &lt;nvpair id=\"status-2-shutdown\" name=\"shutdown\" value=\"0\"/&gt;\n"
"          &lt;nvpair id=\"status-2-probe_complete\" name=\"probe_complete\" value=\"true\"/&gt;\n"
"        &lt;/instance_attributes&gt;\n"
"      &lt;/transient_attributes&gt;\n"
"    &lt;/node_state&gt;\n"
"    &lt;node_state id=\"1\" uname=\"pcmk-1\" in_ccm=\"true\" crmd=\"online\" crm-debug-origin=\"do_state_transition\" join=\"member\" expected=\"member\"&gt;\n"
"      &lt;lrm id=\"1\"&gt;\n"
"        &lt;lrm_resources/&gt;\n"
"      &lt;/lrm&gt;\n"
"      &lt;transient_attributes id=\"1\"&gt;\n"
"        &lt;instance_attributes id=\"status-1\"&gt;\n"
"          &lt;nvpair id=\"status-1-shutdown\" name=\"shutdown\" value=\"0\"/&gt;\n"
"          &lt;nvpair id=\"status-1-probe_complete\" name=\"probe_complete\" value=\"true\"/&gt;\n"
"        &lt;/instance_attributes&gt;\n"
"      &lt;/transient_attributes&gt;\n"
"    &lt;/node_state&gt;\n"
"  &lt;/status&gt;\n"
"&lt;/cib&gt;"
msgstr ""

#. Tag: para
#, no-c-format
msgid "Before we make any changes, it’s a good idea to check the validity of the configuration."
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# crm_verify -L -V\n"
"   error: unpack_resources: Resource start-up disabled since no STONITH resources have been defined\n"
"   error: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option\n"
"   error: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity\n"
"Errors found during check: config not valid"
msgstr ""

#. Tag: para
#, no-c-format
msgid "As you can see, the tool has found some errors."
msgstr ""

#. Tag: para
#, no-c-format
msgid "In order to guarantee the safety of your data, <footnote><para>If the data is corrupt, there is little point in continuing to make it available</para></footnote> the default for STONITH <footnote><para>A common node fencing mechanism. Used to ensure data integrity by powering off \"bad\" nodes</para></footnote> in Pacemaker is <emphasis role=\"strong\">enabled</emphasis>. However, it also knows when no STONITH configuration has been supplied and reports this as a problem (since the cluster would not be able to make progress if a situation requiring node fencing arose)."
msgstr ""

#. Tag: para
#, no-c-format
msgid "We will disable this feature for now and configure it later."
msgstr ""

#. Tag: para
#, no-c-format
msgid "To disable STONITH, set the <emphasis role=\"strong\">stonith-enabled</emphasis> cluster option to false:"
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs property set stonith-enabled=false\n"
"[root@pcmk-1 ~]# crm_verify -L"
msgstr ""

#. Tag: para
#, no-c-format
msgid "With the new cluster option set, the configuration is now valid."
msgstr ""

#. Tag: para
#, no-c-format
msgid "The use of <literal>stonith-enabled=false</literal> is completely inappropriate for a production cluster. It tells the cluster to simply pretend that failed nodes are safely powered off. Some vendors will refuse to support clusters that have STONITH disabled."
msgstr ""

#. Tag: para
#, no-c-format
msgid "We disable STONITH here only to defer the discussion of its configuration, which can differ widely from one installation to the next. See <xref linkend=\"_what_is_stonith\" /> for information on why STONITH is important and details on how to configure it."
msgstr ""

#. Tag: title
#, no-c-format
msgid "Add a Resource"
msgstr ""

#. Tag: para
#, no-c-format
msgid "Our first resource will be a unique IP address that the cluster can bring up on either node. Regardless of where any cluster service(s) are running, end users need a consistent address to contact them on. Here, I will choose 192.168.122.120 as the floating address, give it the imaginative name ClusterIP and tell the cluster to check whether it is running every 30 seconds."
msgstr ""

#. Tag: para
#, no-c-format
msgid "The chosen address must not already be in use on the network. Do not reuse an IP address one of the nodes already has configured."
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs resource create ClusterIP ocf:heartbeat:IPaddr2 \\\n"
"    ip=192.168.122.120 cidr_netmask=32 op monitor interval=30s"
msgstr ""

#. Tag: para
#, no-c-format
msgid "Another important piece of information here is <emphasis role=\"strong\">ocf:heartbeat:IPaddr2</emphasis>. This tells Pacemaker three things about the resource you want to add:"
msgstr ""

#. Tag: para
#, no-c-format
msgid "The first field (<emphasis role=\"strong\">ocf</emphasis> in this case) is the standard to which the resource script conforms and where to find it."
msgstr ""

#. Tag: para
#, no-c-format
msgid "The second field (<emphasis role=\"strong\">heartbeat</emphasis> in this case) is standard-specific; for OCF resources, it tells the cluster which OCF namespace the resource script is in."
msgstr ""

#. Tag: para
#, no-c-format
msgid "The third field (<emphasis role=\"strong\">IPaddr2</emphasis> in this case) is the name of the resource script."
msgstr ""

#. Tag: para
#, no-c-format
msgid "To obtain a list of the available resource standards (the <emphasis role=\"strong\">ocf</emphasis> part of <emphasis role=\"strong\">ocf:heartbeat:IPaddr2</emphasis>), run:"
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs resource standards\n"
"lsb\n"
"ocf\n"
"service\n"
"systemd"
msgstr ""

#. Tag: para
#, no-c-format
msgid "To obtain a list of the available OCF resource providers (the <emphasis role=\"strong\">heartbeat</emphasis> part of <emphasis role=\"strong\">ocf:heartbeat:IPaddr2</emphasis>), run:"
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs resource providers\n"
"heartbeat\n"
"openstack\n"
"pacemaker"
msgstr ""

#. Tag: para
#, no-c-format
msgid "Finally, if you want to see all the resource agents available for a specific OCF provider (the <emphasis role=\"strong\">IPaddr2</emphasis> part of <emphasis role=\"strong\">ocf:heartbeat:IPaddr2</emphasis>), run:"
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs resource agents ocf:heartbeat\n"
"apache\n"
"clvm\n"
"conntrackd\n"
"CTDB\n"
"db2\n"
"Delay\n"
".\n"
". (skipping lots of resources to save space)\n"
".\n"
"symlink\n"
"tomcat\n"
"VirtualDomain\n"
"Xinetd"
msgstr ""

#. Tag: para
#, no-c-format
msgid "Now, verify that the IP resource has been added, and display the cluster’s status to see that it is now active:"
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs status\n"
"Cluster name: mycluster\n"
"Stack: corosync\n"
"Current DC: pcmk-1 (version 1.1.16-12.el7_4.5-94ff4df) - partition with quorum\n"
"Last updated: Fri Jan 12 17:44:40 2018\n"
"Last change: Fri Jan 12 17:44:26 2018\n"
"\n"
"2 nodes configured\n"
"1 resources configured\n"
"\n"
"Online: [ pcmk-1 pcmk-2 ]\n"
"\n"
"Full list of resources:\n"
"\n"
" ClusterIP      (ocf::heartbeat:IPaddr2):       Started pcmk-1\n"
"\n"
"Daemon Status:\n"
"  corosync: active/disabled\n"
"  pacemaker: active/disabled\n"
"  pcsd: active/enabled"
msgstr ""

#. Tag: title
#, no-c-format
msgid "Perform a Failover"
msgstr ""

#. Tag: para
#, no-c-format
msgid "Since our ultimate goal is high availability, we should test failover of our new resource before moving on."
msgstr ""

#. Tag: para
#, no-c-format
msgid "First, find the node on which the IP address is running."
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs status\n"
"Cluster name: mycluster\n"
"Stack: corosync\n"
"Current DC: pcmk-1 (version 1.1.16-12.el7_4.5-94ff4df) - partition with quorum\n"
"Last updated: Fri Jan 12 17:44:40 2018\n"
"Last change: Fri Jan 12 17:44:26 2018\n"
"\n"
"2 nodes configured\n"
"1 resources configured\n"
"\n"
"Online: [ pcmk-1 pcmk-2 ]\n"
"\n"
"Full list of resources:\n"
"\n"
" ClusterIP      (ocf::heartbeat:IPaddr2):       Started pcmk-1"
msgstr ""

#. Tag: para
#, no-c-format
msgid "You can see that the status of the <emphasis role=\"strong\">ClusterIP</emphasis> resource is <emphasis role=\"strong\">Started</emphasis> on a particular node (in this example, <emphasis role=\"strong\">pcmk-1</emphasis>). Shut down Pacemaker and Corosync on that machine to trigger a failover."
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs cluster stop pcmk-1\n"
"Stopping Cluster (pacemaker)...\n"
"Stopping Cluster (corosync)..."
msgstr ""

#. Tag: para
#, no-c-format
msgid "A cluster command such as <literal>pcs cluster stop <replaceable>nodename</replaceable></literal> can be run from any node in the cluster, not just the affected node."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Verify that pacemaker and corosync are no longer running:"
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs status\n"
"Error: cluster is not currently running on this node"
msgstr ""

#. Tag: para
#, no-c-format
msgid "Go to the other node, and check the cluster status."
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-2 ~]# pcs status\n"
"Cluster name: mycluster\n"
"Stack: corosync\n"
"Current DC: pcmk-2 (version 1.1.16-12.el7_4.5-94ff4df) - partition with quorum\n"
"Last updated: Fri Jan 12 18:30:56 2018\n"
"Last change: Fri Jan 12 17:44:26 2018\n"
"\n"
"2 nodes configured\n"
"1 resources configured\n"
"\n"
"Online: [ pcmk-2 ]\n"
"OFFLINE: [ pcmk-1 ]\n"
"\n"
"Full list of resources:\n"
"\n"
" ClusterIP      (ocf::heartbeat:IPaddr2):       Started pcmk-2\n"
"\n"
"Daemon Status:\n"
"  corosync: active/disabled\n"
"  pacemaker: active/disabled\n"
"  pcsd: active/enabled"
msgstr ""

#. Tag: para
#, no-c-format
msgid "Notice that <emphasis role=\"strong\">pcmk-1</emphasis> is <emphasis role=\"strong\">OFFLINE</emphasis> for cluster purposes (its <emphasis role=\"strong\">pcsd</emphasis> is still active, allowing it to receive <literal>pcs</literal> commands, but it is not participating in the cluster)."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Also notice that <emphasis role=\"strong\">ClusterIP</emphasis> is now running on <emphasis role=\"strong\">pcmk-2</emphasis> — failover happened automatically, and no errors are reported."
msgstr ""

#. Tag: title
#, no-c-format
msgid "Quorum"
msgstr ""

#. Tag: para
#, no-c-format
msgid "If a cluster splits into two (or more) groups of nodes that can no longer communicate with each other (aka. <emphasis>partitions</emphasis>), <emphasis>quorum</emphasis> is used to prevent resources from starting on more nodes than desired, which would risk data corruption."
msgstr ""

#. Tag: para
#, no-c-format
msgid "A cluster has quorum when more than half of all known nodes are online in the same partition, or for the mathematically inclined, whenever the following equation is true:"
msgstr ""

#. Tag: literallayout
#, no-c-format
msgid "total_nodes &lt; 2 * active_nodes"
msgstr ""

#. Tag: para
#, no-c-format
msgid "For example, if a 5-node cluster split into 3- and 2-node paritions, the 3-node partition would have quorum and could continue serving resources. If a 6-node cluster split into two 3-node partitions, neither partition would have quorum; pacemaker’s default behavior in such cases is to stop all resources, in order to prevent data corruption."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Two-node clusters are a special case. By the above definition, a two-node cluster would only have quorum when both nodes are running. This would make the creation of a two-node cluster pointless, <footnote><para>Some would argue that two-node clusters are always pointless, but that is an argument for another time</para></footnote> but corosync has the ability to treat two-node clusters as if only one node is required for quorum."
msgstr ""

#. Tag: para
#, no-c-format
msgid "The <literal>pcs cluster setup</literal> command will automatically configure <emphasis role=\"strong\">two_node: 1</emphasis> in <literal>corosync.conf</literal>, so a two-node cluster will \"just work\"."
msgstr ""

#. Tag: para
#, no-c-format
msgid "If you are using a different cluster shell, you will have to configure <literal>corosync.conf</literal> appropriately yourself."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Now, simulate node recovery by restarting the cluster stack on <emphasis role=\"strong\">pcmk-1</emphasis>, and check the cluster’s status. (It may take a little while before the cluster gets going on the node, but it eventually will look like the below.)"
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs cluster start pcmk-1\n"
"pcmk-1: Starting Cluster...\n"
"[root@pcmk-1 ~]# pcs status\n"
"Cluster name: mycluster\n"
"Stack: corosync\n"
"Current DC: pcmk-2 (version 1.1.16-12.el7_4.5-94ff4df) - partition with quorum\n"
"Last updated: Fri Jan 12 18:50:11 2018\n"
"Last change: Fri Jan 12 17:44:26 2018\n"
"\n"
"2 nodes configured\n"
"1 resources configured\n"
"\n"
"Online: [ pcmk-1 pcmk-2 ]\n"
"\n"
"Full list of resources:\n"
"\n"
" ClusterIP      (ocf::heartbeat:IPaddr2):       Started pcmk-2\n"
"\n"
"Daemon Status:\n"
"  corosync: active/disabled\n"
"  pacemaker: active/disabled\n"
"  pcsd: active/enabled"
msgstr ""

#. Tag: title
#, no-c-format
msgid "Prevent Resources from Moving after Recovery"
msgstr ""

#. Tag: para
#, no-c-format
msgid "In most circumstances, it is highly desirable to prevent healthy resources from being moved around the cluster. Moving resources almost always requires a period of downtime. For complex services such as databases, this period can be quite long."
msgstr ""

#. Tag: para
#, no-c-format
msgid "To address this, Pacemaker has the concept of resource <emphasis>stickiness</emphasis>, which controls how strongly a service prefers to stay running where it is. You may like to think of it as the \"cost\" of any downtime. By default, Pacemaker assumes there is zero cost associated with moving resources and will do so to achieve \"optimal\" <footnote><para>Pacemaker’s definition of optimal may not always agree with that of a human’s. The order in which Pacemaker processes lists of resources and nodes creates implicit preferences in situations where the administrator has not explicitly specified them.</para></footnote> resource placement. We can specify a different stickiness for every resource, but it is often sufficient to change the default."
msgstr ""

#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs resource defaults resource-stickiness=100\n"
"[root@pcmk-1 ~]# pcs resource defaults\n"
"resource-stickiness: 100"
msgstr ""