#
# 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 "Add Apache HTTP Server as a Cluster Service"
msgstr ""
#. Tag: para
#, no-c-format
msgid "<indexterm> <primary>Apache HTTP Server</primary> </indexterm>"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Now that we have a basic but functional active/passive two-node cluster, we’re ready to add some real services. We’re going to start with Apache HTTP Server because it is a feature of many clusters and relatively simple to configure."
msgstr ""
#. Tag: title
#, no-c-format
msgid "Install Apache"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Before continuing, we need to make sure Apache is installed on both hosts. We also need the wget tool in order for the cluster to be able to check the status of the Apache server."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "# yum install -y httpd wget\n"
"# firewall-cmd --permanent --add-service=http\n"
"# firewall-cmd --reload"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Do <emphasis role=\"strong\">not</emphasis> enable the httpd service. Services that are intended to be managed via the cluster software should never be managed by the OS."
msgstr ""
#. Tag: para
#, no-c-format
msgid "It is often useful, however, to manually start the service, verify that it works, then stop it again, before adding it to the cluster. This allows you to resolve any non-cluster-related problems before continuing. Since this is a simple example, we’ll skip that step here."
msgstr ""
#. Tag: title
#, no-c-format
msgid "Create Website Documents"
msgstr ""
#. Tag: para
#, no-c-format
msgid "We need to create a page for Apache to serve. On &DISTRO; &DISTRO_VERSION;, the default Apache document root is /var/www/html, so we’ll create an index file there. For the moment, we will simplify things by serving a static site and manually synchronizing the data between the two nodes, so run this command on both nodes:"
msgstr ""
#. Tag: screen
#, no-c-format
msgid "# cat <<-END >/var/www/html/index.html\n"
" <html>\n"
" <body>My Test Site - $(hostname)</body>\n"
" </html>\n"
"END"
msgstr ""
#. Tag: title
#, no-c-format
msgid "Enable the Apache status URL"
msgstr ""
#. Tag: para
#, no-c-format
msgid "<indexterm> <primary>Apache HTTP Server</primary><secondary>/server-status</secondary> </indexterm> <indexterm> <primary>/server-status</primary> </indexterm>"
msgstr ""
#. Tag: para
#, no-c-format
msgid "In order to monitor the health of your Apache instance, and recover it if it fails, the resource agent used by Pacemaker assumes the server-status URL is available. On both nodes, enable the URL with:"
msgstr ""
#. Tag: screen
#, no-c-format
msgid "# cat <<-END >/etc/httpd/conf.d/status.conf\n"
" <Location /server-status>\n"
" SetHandler server-status\n"
" Require local\n"
" </Location>\n"
"END"
msgstr ""
#. Tag: para
#, no-c-format
msgid "If you are using a different operating system, server-status may already be enabled or may be configurable in a different location. If you are using a version of Apache HTTP Server less than 2.4, the syntax will be different."
msgstr ""
#. Tag: title
#, no-c-format
msgid "Configure the Cluster"
msgstr ""
#. Tag: para
#, no-c-format
msgid "<indexterm> <primary>Apache HTTP Server</primary><secondary>Apache resource configuration</secondary> </indexterm> <indexterm> <primary>Apache resource configuration</primary> </indexterm>"
msgstr ""
#. Tag: para
#, no-c-format
msgid "At this point, Apache is ready to go, and all that needs to be done is to add it to the cluster. Let’s call the resource WebSite. We need to use an OCF resource script called apache in the heartbeat namespace. <footnote><para>Compare the key used here, <emphasis role=\"strong\">ocf:heartbeat:apache</emphasis>, with the one we used earlier for the IP address, <emphasis role=\"strong\">ocf:heartbeat:IPaddr2</emphasis></para></footnote> The script’s only required parameter is the path to the main Apache configuration file, and we’ll tell the cluster to check once a minute that Apache is still running."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs resource create WebSite ocf:heartbeat:apache \\\n"
" configfile=/etc/httpd/conf/httpd.conf \\\n"
" statusurl=\"http://localhost/server-status\" \\\n"
" op monitor interval=1min"
msgstr ""
#. Tag: para
#, no-c-format
msgid "By default, the operation timeout for all resources' start, stop, and monitor operations is 20 seconds. In many cases, this timeout period is less than a particular resource’s advised timeout period. For the purposes of this tutorial, we will adjust the global operation timeout default to 240 seconds."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs resource op defaults timeout=240s\n"
"[root@pcmk-1 ~]# pcs resource op defaults\n"
"timeout: 240s"
msgstr ""
#. Tag: para
#, no-c-format
msgid "In a production cluster, it is usually better to adjust each resource’s start, stop, and monitor timeouts to values that are appropriate to the behavior observed in your environment, rather than adjust the global default."
msgstr ""
#. Tag: para
#, no-c-format
msgid "After a short delay, we should see the cluster start Apache."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[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 12:40:41 2018\n"
"Last change: Fri Jan 12 12:40:05 2018\n"
"\n"
"2 nodes configured\n"
"2 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"
" WebSite (ocf::heartbeat:apache): Started pcmk-1\n"
"\n"
"Daemon Status:\n"
" corosync: active/disabled\n"
" pacemaker: active/disabled\n"
" pcsd: active/enabled"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Wait a moment, the WebSite resource isn’t running on the same host as our IP address!"
msgstr ""
#. Tag: para
#, no-c-format
msgid "If, in the <literal>pcs status</literal> output, you see the WebSite resource has failed to start, then you’ve likely not enabled the status URL correctly. You can check whether this is the problem by running:"
msgstr ""
#. Tag: literallayout
#, no-c-format
msgid "wget -O - http://localhost/server-status"
msgstr ""
#. Tag: para
#, no-c-format
msgid "If you see <emphasis role=\"strong\">Not Found</emphasis> or <emphasis role=\"strong\">Forbidden</emphasis> in the output, then this is likely the problem. Ensure that the <emphasis role=\"strong\"><Location /server-status></emphasis> block is correct."
msgstr ""
#. Tag: title
#, no-c-format
msgid "Ensure Resources Run on the Same Host"
msgstr ""
#. Tag: para
#, no-c-format
msgid "To reduce the load on any one machine, Pacemaker will generally try to spread the configured resources across the cluster nodes. However, we can tell the cluster that two resources are related and need to run on the same host (or not at all). Here, we instruct the cluster that WebSite can only run on the host that ClusterIP is active on."
msgstr ""
#. Tag: para
#, no-c-format
msgid "To achieve this, we use a <emphasis>colocation constraint</emphasis> that indicates it is mandatory for WebSite to run on the same node as ClusterIP. The \"mandatory\" part of the colocation constraint is indicated by using a score of INFINITY. The INFINITY score also means that if ClusterIP is not active anywhere, WebSite will not be permitted to run."
msgstr ""
#. Tag: para
#, no-c-format
msgid "If ClusterIP is not active anywhere, WebSite will not be permitted to run anywhere."
msgstr ""
#. Tag: para
#, no-c-format
msgid "Colocation constraints are \"directional\", in that they imply certain things about the order in which the two resources will have a location chosen. In this case, we’re saying that <emphasis role=\"strong\">WebSite</emphasis> needs to be placed on the same machine as <emphasis role=\"strong\">ClusterIP</emphasis>, which implies that the cluster must know the location of <emphasis role=\"strong\">ClusterIP</emphasis> before choosing a location for <emphasis role=\"strong\">WebSite</emphasis>."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs constraint colocation add WebSite with ClusterIP INFINITY\n"
"[root@pcmk-1 ~]# pcs constraint\n"
"Location Constraints:\n"
"Ordering Constraints:\n"
"Colocation Constraints:\n"
" WebSite with ClusterIP (score:INFINITY)\n"
"Ticket Constraints:\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 13:57:58 2018\n"
"Last change: Fri Jan 12 13:57:22 2018\n"
"\n"
"2 nodes configured\n"
"2 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"
" WebSite (ocf::heartbeat:apache): 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 "Ensure Resources Start and Stop in Order"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Like many services, Apache can be configured to bind to specific IP addresses on a host or to the wildcard IP address. If Apache binds to the wildcard, it doesn’t matter whether an IP address is added before or after Apache starts; Apache will respond on that IP just the same. However, if Apache binds only to certain IP address(es), the order matters: If the address is added after Apache starts, Apache won’t respond on that address."
msgstr ""
#. Tag: para
#, no-c-format
msgid "To be sure our WebSite responds regardless of Apache’s address configuration, we need to make sure ClusterIP not only runs on the same node, but starts before WebSite. A colocation constraint only ensures the resources run together, not the order in which they are started and stopped."
msgstr ""
#. Tag: para
#, no-c-format
msgid "We do this by adding an ordering constraint. By default, all order constraints are mandatory, which means that the recovery of ClusterIP will also trigger the recovery of WebSite."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs constraint order ClusterIP then WebSite\n"
"Adding ClusterIP WebSite (kind: Mandatory) (Options: first-action=start then-action=start)\n"
"[root@pcmk-1 ~]# pcs constraint\n"
"Location Constraints:\n"
"Ordering Constraints:\n"
" start ClusterIP then start WebSite (kind:Mandatory)\n"
"Colocation Constraints:\n"
" WebSite with ClusterIP (score:INFINITY)\n"
"Ticket Constraints:"
msgstr ""
#. Tag: title
#, no-c-format
msgid "Prefer One Node Over Another"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Pacemaker does not rely on any sort of hardware symmetry between nodes, so it may well be that one machine is more powerful than the other. In such cases, it makes sense to host the resources on the more powerful node if it is available. To do this, we create a location constraint."
msgstr ""
#. Tag: para
#, no-c-format
msgid "In the location constraint below, we are saying the WebSite resource prefers the node pcmk-1 with a score of 50. Here, the score indicates how badly we’d like the resource to run at this location."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs constraint location WebSite prefers pcmk-1=50\n"
"[root@pcmk-1 ~]# pcs constraint\n"
"Location Constraints:\n"
" Resource: WebSite\n"
" Enabled on: pcmk-1 (score:50)\n"
"Ordering Constraints:\n"
" start ClusterIP then start WebSite (kind:Mandatory)\n"
"Colocation Constraints:\n"
" WebSite with ClusterIP (score:INFINITY)\n"
"Ticket Constraints:\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 14:11:49 2018\n"
"Last change: Fri Jan 12 14:11:20 2018\n"
"\n"
"2 nodes configured\n"
"2 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"
" WebSite (ocf::heartbeat:apache): 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 "Wait a minute, the resources are still on pcmk-2!"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Even though WebSite now prefers to run on pcmk-1, that preference is (intentionally) less than the resource stickiness (how much we preferred not to have unnecessary downtime)."
msgstr ""
#. Tag: para
#, no-c-format
msgid "To see the current placement scores, you can use a tool called crm_simulate."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# crm_simulate -sL\n"
"\n"
"Current cluster status:\n"
"Online: [ pcmk-1 pcmk-2 ]\n"
"\n"
" ClusterIP (ocf::heartbeat:IPaddr2): Started pcmk-2\n"
" WebSite (ocf::heartbeat:apache): Started pcmk-2\n"
"\n"
"Allocation scores:\n"
"native_color: ClusterIP allocation score on pcmk-1: 50\n"
"native_color: ClusterIP allocation score on pcmk-2: 200\n"
"native_color: WebSite allocation score on pcmk-1: -INFINITY\n"
"native_color: WebSite allocation score on pcmk-2: 100\n"
"\n"
"Transition Summary:"
msgstr ""
#. Tag: title
#, no-c-format
msgid "Move Resources Manually"
msgstr ""
#. Tag: para
#, no-c-format
msgid "There are always times when an administrator needs to override the cluster and force resources to move to a specific location. In this example, we will force the WebSite to move to pcmk-1 by updating our previous location constraint with a score of INFINITY."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs constraint location WebSite prefers pcmk-1=INFINITY\n"
"[root@pcmk-1 ~]# pcs constraint\n"
"Location Constraints:\n"
" Resource: WebSite\n"
" Enabled on: pcmk-1 (score:INFINITY)\n"
"Ordering Constraints:\n"
" start ClusterIP then start WebSite (kind:Mandatory)\n"
"Colocation Constraints:\n"
" WebSite with ClusterIP (score:INFINITY)\n"
"Ticket Constraints:\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 14:19:34 2018\n"
"Last change: Fri Jan 12 14:18:37 2018\n"
"\n"
"2 nodes configured\n"
"2 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"
" WebSite (ocf::heartbeat:apache): Started pcmk-1\n"
"\n"
"Daemon Status:\n"
" corosync: active/disabled\n"
" pacemaker: active/disabled\n"
" pcsd: active/enabled"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Once we’ve finished whatever activity required us to move the resources to pcmk-1 (in our case nothing), we can then allow the cluster to resume normal operation by removing the new constraint. Since we previously configured a default stickiness, the resources will remain on pcmk-1."
msgstr ""
#. Tag: para
#, no-c-format
msgid "First, use the <literal>--full</literal> option to get the constraint’s ID:"
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs constraint --full\n"
"Location Constraints:\n"
" Resource: WebSite\n"
" Enabled on: pcmk-1 (score:INFINITY) (id:location-WebSite-pcmk-1-INFINITY)\n"
"Ordering Constraints:\n"
" start ClusterIP then start WebSite (kind:Mandatory) (id:order-ClusterIP-WebSite-mandatory)\n"
"Colocation Constraints:\n"
" WebSite with ClusterIP (score:INFINITY) (id:colocation-WebSite-ClusterIP-INFINITY)\n"
"Ticket Constraints:"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Then remove the desired contraint using its ID:"
msgstr ""
#. Tag: screen
#, no-c-format
msgid "[root@pcmk-1 ~]# pcs constraint remove location-WebSite-pcmk-1-INFINITY\n"
"[root@pcmk-1 ~]# pcs constraint\n"
"Location Constraints:\n"
"Ordering Constraints:\n"
" start ClusterIP then start WebSite (kind:Mandatory)\n"
"Colocation Constraints:\n"
" WebSite with ClusterIP (score:INFINITY)\n"
"Ticket Constraints:"
msgstr ""
#. Tag: para
#, no-c-format
msgid "Note that the location constraint is now gone. If we check the cluster status, we can also see that (as expected) the resources are still active on pcmk-1."
msgstr ""
#. Tag: screen
#, no-c-format
msgid "# 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 14:25:21 2018\n"
"Last change: Fri Jan 12 14:24:29 2018\n"
"\n"
"2 nodes configured\n"
"2 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"
" WebSite (ocf::heartbeat:apache): Started pcmk-1\n"
"\n"
"Daemon Status:\n"
" corosync: active/disabled\n"
" pacemaker: active/disabled\n"
" pcsd: active/enabled"
msgstr ""