{"id":2179,"date":"2017-12-20T17:36:42","date_gmt":"2017-12-20T14:36:42","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/how-to-set-up-nginx-high-availability-with-pacemaker-corosync-on-centos-7\/"},"modified":"2017-12-20T17:36:42","modified_gmt":"2017-12-20T14:36:42","slug":"how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7\/","title":{"rendered":"How to Set up Nginx High Availability with Pacemaker and Corosync on CentOS 7"},"content":{"rendered":"<p>In this tutorial, we will guide you step by step on how to create a\u00a0High Availability Cluster Nginx Web Server with Pacemaker, Corosync, and Pcsd. We will create the Active-Passive Cluster or Failover-cluster Nginx web server using Pacemaker on a CentOS 7 system.<\/p>\n<p><strong>Pacemaker<\/strong> is an open source cluster manager software that achieves maximum high availability of your services. It&#8217;s an advanced and scalable HA cluster manager distributed by ClusterLabs.<\/p>\n<p><strong>Corosync<\/strong> Cluster Engine is an open source project derived from the OpenAIS project under new BSD License. It&#8217;s a group communication system with additional features for implementing High Availability within applications.<\/p>\n<p>There are some applications for the Pacemaker interfaces. <strong>Pcsd<\/strong> is one of the Pacemaker command line interface and GUI for managing the Pacemaker. We can create, configure, or add a new node to the cluster with the pcsd command pcs.<\/p>\n<p><strong>Prerequisites<\/strong><\/p>\n<ul>\n<li>2 or more CentOS 7 Server\n<ul>\n<li><em>web01\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10.0.15.10<\/em><\/li>\n<li><em>web02\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10.0.15.11<\/em><\/li>\n<li><em>web03\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10.0.15.12<\/em><\/li>\n<\/ul>\n<\/li>\n<li>Floating IP Address 10.0.15.15<\/li>\n<li>Root Privileges<\/li>\n<\/ul>\n<p><strong>What we will do:<\/strong><\/p>\n<ol>\n<li>Map the Host File<\/li>\n<li>Install Epel Repository and Nginx<\/li>\n<li>Install and Configure Pacemaker, Corosync, and Pcsd<\/li>\n<li>Create and Configure the Cluster<\/li>\n<li>Disable STONITH and Ignore the Quorum Policy<\/li>\n<li>Add the Floating-IP and Resources<\/li>\n<li>Add Rules to the Cluster<\/li>\n<li>Configure Firewalld<\/li>\n<li>Test the setup<\/li>\n<\/ol>\n<h2 id=\"step-map-the-host-file\">Step 1 &#8211; Map the Host File<\/h2>\n<p><strong>Note<\/strong>:\u00a0Run step 1 &#8211; 3 on all servers web01, web02 and web03.<\/p>\n<p>The first step we must do is to\u00a0edit the host file on each server in order to map the hostname of all servers. We&#8217;ve &#8216;web01&#8217;, &#8216;web02&#8217; and &#8216;web03&#8217; servers, login to the each server with the ssh account.<\/p>\n<p class=\"command\">ssh <a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"d1a3bebea591a6b4b3\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>[01,02,03]\n<p>Edit the &#8216;\/etc\/hosts&#8217; file with <a href=\"https:\/\/www.howtoforge.com\/vim-basics\" target=\"_blank\" rel=\"noopener noreferrer\">vim<\/a>.<\/p>\n<p class=\"command\">vim \/etc\/hosts<\/p>\n<p>Paste the following configuration there.<\/p>\n<pre class=\"system\">10.0.15.10\u00a0\u00a0\u00a0\u00a0\u00a0 web01<br\/>10.0.15.11\u00a0\u00a0\u00a0\u00a0\u00a0 web02<br\/>10.0.15.12\u00a0\u00a0\u00a0\u00a0\u00a0 web03<\/pre>\n<p>Save and exit.<\/p>\n<p>Now test the hosts&#8217; mapping configuration.<\/p>\n<p class=\"command\">ping -c 3 web01<br \/>ping -c 3 web02<br \/>ping -c 3 web03<\/p>\n<p>Make sure &#8216;web01&#8217;, &#8216;web02&#8217; and &#8216;web03&#8217; are\u00a0mapped to correct IP addresses.<\/p>\n<p><a class=\"fancybox\" id=\"img-1\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7.png\" alt=\"Check server interconnection with ping\" width=\"500\" height=\"453\" title=\"\"><\/a><\/p>\n<h2 id=\"step-install-epel-repository-and-nginx\">Step 2 &#8211; Install Epel Repository and Nginx<\/h2>\n<p>In this step, we will install the epel repository and then install the Nginx web server. EPEL or Extra Packages for Enterprise Linux repository is needed for installing Nginx packages.<\/p>\n<p>Install EPEL Repository using the following\u00a0yum command.<\/p>\n<p class=\"command\">yum -y install epel-release<\/p>\n<p>Now install Nginx web server from the EPEL repository.<\/p>\n<p class=\"command\">yum -y install nginx<\/p>\n<p>After\u00a0the installation is complete, change the default index.html page on each server with a new page.<\/p>\n<p class=\"command\">#Run Command on &#8216;web01&#8217;<br \/>echo &#8216;&lt;h1&gt;web01 &#8211; hakase-labs&lt;\/h1&gt;&#8217; &gt; \/usr\/share\/nginx\/html\/index.html<\/p>\n<p>#Run Command on &#8216;web02&#8217;<br \/>echo &#8216;&lt;h1&gt;web02 &#8211; hakase-labs&lt;\/h1&gt;&#8217; &gt; \/usr\/share\/nginx\/html\/index.html<\/p>\n<p>#Run Command on &#8216;web03&#8217;<br \/>echo &#8216;&lt;h1&gt;web03 &#8211; hakase-labs&lt;\/h1&gt;&#8217; &gt; \/usr\/share\/nginx\/html\/index.html<\/p>\n<p><a class=\"fancybox\" id=\"img-2\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-1.png\" alt=\"Install epel repo and nginx\" width=\"500\" height=\"343\" title=\"\"><\/a><\/p>\n<p>EPEL Repository and Nginx web server are now installed on the system.<\/p>\n<h2 id=\"step-install-and-configure-pacemaker-corosync-and-pcsd\">Step 3 &#8211; Install and configure Pacemaker, Corosync, and Pcsd<\/h2>\n<p>Pacemaker, Corosync, and Pcsd are available in\u00a0the default system repository. So they\u00a0all can be installed from the CentOS repository using the following\u00a0yum command.<\/p>\n<p class=\"command\">yum -y install corosync pacemaker pcs<\/p>\n<p>After\u00a0the installation has been completed, enable all services to launch automatically at system boot\u00a0using the systemctl commands below.<\/p>\n<p class=\"command\">systemctl enable pcsd<br \/>systemctl enable corosync<br \/>systemctl enable pacemaker<\/p>\n<p>Now start the pcsd Pacemaker command line interface on all servers.<\/p>\n<p class=\"command\">systemctl start pcsd<\/p>\n<p>Next, create a new password for &#8216;hacluster&#8217; user and use the same password for all servers. This user has been created automatically during software installation.<\/p>\n<p>Here&#8217;s how you configure a password for the &#8216;<strong>hacluster<\/strong>&#8216; user.<\/p>\n<p class=\"command\">passwd hacluster<br \/>Enter new password:<\/p>\n<p>High Availability software stack Pacemaker, Corosync, and Pcsd are installed on to the system.<\/p>\n<p><a class=\"fancybox\" id=\"img-31\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/31.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-2.png\" alt=\"Install and configure Pacemaker, Corosync, and Pcsd\" width=\"500\" height=\"157\" title=\"\"><\/a><\/p>\n<h2 id=\"step-create-and-configure-the-cluster\">Step 4 &#8211; Create and Configure the Cluster<\/h2>\n<p><strong>Note<\/strong>: Run steps 4 &#8211; 7 on <strong>&#8216;web01&#8217;<\/strong> only.<\/p>\n<p>In this step, we will create a new cluster with 3 centos servers. Then configure\u00a0the Floating IP address and add\u00a0new Nginx resources.<\/p>\n<p>To create the cluster, we need to authorize all servers using the pcs command and the hacluster user.<\/p>\n<p>Authorize all servers with the pcs command and hacluster user and password.<\/p>\n<p class=\"command\">pcs cluster auth web01 web02 web03<br \/>Username: hacluster<br \/>Password: <a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"3958484e5c080b0a79\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a><\/p>\n<p><a class=\"fancybox\" id=\"img-4\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-3.png\" alt=\"Create and Configure the Cluster\" width=\"500\" height=\"163\" title=\"\"><\/a><\/p>\n<p>Now it&#8217;s time set up the cluster. Define the cluster name and all servers that will be part of the cluster.<\/p>\n<p class=\"command\">pcs cluster setup &#8211;name hakase_cluster web01 web02 web03<\/p>\n<p>Now start all cluster services and also enable them.<\/p>\n<p class=\"command\">pcs cluster start &#8211;all<br \/>pcs cluster enable &#8211;all<\/p>\n<p><a class=\"fancybox\" id=\"img-5\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-4.png\" alt=\"Start the cluster\" width=\"500\" height=\"195\" title=\"\"><\/a><\/p>\n<p>Next, check the cluster status.<\/p>\n<p class=\"command\">pcs status cluster<\/p>\n<p><a class=\"fancybox\" id=\"img-6\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-5.png\" alt=\"Check cluster status\" width=\"500\" height=\"221\" title=\"\"><\/a><\/p>\n<h2 id=\"step-disable-stonith-and-ignore-the-quorum-policy\">Step 5 &#8211; Disable STONITH and Ignore the Quorum Policy<\/h2>\n<p>Since we&#8217;re not using the fencing device, we will disable the STONITH. STONITH or Shoot The Other Node In The Head is the fencing implementation on Pacemaker. If you&#8217;re in production, it&#8217;s better to enable STONITH.<\/p>\n<p>Disable STONITH with the following pcs command.<\/p>\n<p class=\"command\">pcs property set stonith-enabled=false<\/p>\n<p>Next, for the Quorum policy, ignore it.<\/p>\n<p class=\"command\">pcs property set no-quorum-policy=ignore<\/p>\n<p>Check the property list and make sure stonith and the quorum policy are disabled.<\/p>\n<p class=\"command\">pcs property list<\/p>\n<p><a class=\"fancybox\" id=\"img-7\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-6.png\" alt=\"Disable STONITH and Ignore the Quorum Policy\" width=\"500\" height=\"218\" title=\"\"><\/a><\/p>\n<p>The STONITH and Quorum Policy is disabled.<\/p>\n<h2 id=\"step-add-the-floatingip-and-resources\">Step 6 &#8211; Add the Floating-IP and Resources<\/h2>\n<p>Floating IP is the IP address that can be migrated\/moved automatically from one server to another server in\u00a0the same Data Center. And we&#8217;ve already defined the floating IP address for the Pacemaker High-Availability to be &#8216;10.0.15.15&#8217;. Now we want to add two resources, the Floating IP address resource with the name &#8216;virtual_ip&#8217; and a new resource for the Nginx web server named &#8216;webserver&#8217;.<\/p>\n<p>Add the new resource floating IP address &#8216;virtual_ip&#8217; using the\u00a0pcs command as shown below.<\/p>\n<p class=\"command\">pcs resource create virtual_ip ocf:heartbeat:IPaddr2 ip=10.0.15.15 cidr_netmask=32 op monitor interval=30s<\/p>\n<p>Next, add a new resource for the Nginx &#8216;webserver&#8217;.<\/p>\n<p class=\"command\">pcs resource create webserver ocf:heartbeat:nginx configfile=\/etc\/nginx\/nginx.conf op monitor timeout=&#8221;5s&#8221; interval=&#8221;5s&#8221;<\/p>\n<p>Make sure you got no error result, then check the resources available.<\/p>\n<p class=\"command\">pcs status resources<\/p>\n<p>You will see two resources &#8216;virtual_ip&#8217; and a &#8216;webserver&#8217;. New resources for the Floating IP and Nginx web server have been added.<\/p>\n<p><a class=\"fancybox\" id=\"img-8\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-7.png\" alt=\"Add the Floating-IP and Resources\" width=\"500\" height=\"88\" title=\"\"><\/a><\/p>\n<h2 id=\"step-add-constraint-rules-to-the-cluster\">Step 7 &#8211; Add Constraint Rules to the Cluster<\/h2>\n<p>In this step, we will setup High Availability Rules, and will setup resource constraint with the pcs command line interface.<\/p>\n<p>Set the collation constraint for webserver and virtual_ip resources with score &#8216;INFINITY&#8217;. Also, setup the webserver and virtual_ip resources as\u00a0same on all server nodes.<\/p>\n<p class=\"command\">pcs constraint colocation add webserver virtual_ip INFINITY<\/p>\n<p>Set the &#8216;virtual_ip&#8217; and &#8216;webserver&#8217; resources always on same node servers.<\/p>\n<p class=\"command\">pcs constraint order virtual_ip then the webserver<\/p>\n<p>Next, stop the cluster and then start again.<\/p>\n<p class=\"command\">pcs cluster stop &#8211;all<br \/>pcs cluster start &#8211;all<\/p>\n<p><a class=\"fancybox\" id=\"img-9\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-8.png\" alt=\"Add Constraint Rules to the Cluster\" width=\"500\" height=\"200\" title=\"\"><\/a><\/p>\n<p>Now, check again the resources and you will see their\u00a0status as\u00a0&#8216;Started&#8217; on the same server &#8216;web01&#8217;.<\/p>\n<p class=\"command\">pcs status resources<\/p>\n<p><a class=\"fancybox\" id=\"img-10\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/10.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-9.png\" alt=\"Check pcs status\" width=\"500\" height=\"109\" title=\"\"><\/a><\/p>\n<p>virtual_ip and webserver resources have been started on the same server\/node &#8216;web01&#8217;.<\/p>\n<h2 id=\"step-configure-firewalld\">Step 8 &#8211; Configure Firewalld<\/h2>\n<p>The HA-Cluster will run under the firewall configuration firewalld &#8211; install it if you do not have the package.<\/p>\n<p class=\"command\">yum -y install firewalld<\/p>\n<p>Start firewalld and enable\u00a0it to run automatically every time at system boot\u00a0using following systemctl commands.<\/p>\n<p class=\"command\">systemctl start firewalld<br \/>systemctl enable firewalld<\/p>\n<p>Next, add new services to the firewalld with firewall-cmd commands &#8211; add high-availability service, HTTP, and HTTPS services for Nginx.<\/p>\n<p class=\"command\">firewall-cmd &#8211;permanent &#8211;add-service=high-availability<br \/>firewall-cmd &#8211;permanent &#8211;add-service=http<br \/>firewall-cmd &#8211;permanent &#8211;add-service=https<\/p>\n<p><a class=\"fancybox\" id=\"img-11\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/11.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-10.png\" alt=\"Configure Firewalld\" width=\"500\" height=\"128\" title=\"\"><\/a><\/p>\n<p>Reload the firewall configuration, and check all services.<\/p>\n<p class=\"command\">firewall-cmd &#8211;reload<br \/>firewall-cmd &#8211;list-all<\/p>\n<p>Make sure ha service with HTTP and https is there on the list.<\/p>\n<p><a class=\"fancybox\" id=\"img-12\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/12.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-11.png\" alt=\"Reload firewall and check firewall ruleset\" width=\"500\" height=\"322\" title=\"\"><\/a><\/p>\n<h2 id=\"step-testing\">Step 9 &#8211; Testing<\/h2>\n<p>In this step, we&#8217;re gonna do some test for the cluster. Test the node status (&#8216;Online&#8217; or &#8216;Offline&#8217;), test the corosync members and status, and then test the high-availability of the Nginx webserver by accessing the Floating IP address.<\/p>\n<p>Test node status with the following command.<\/p>\n<p class=\"command\">pcs status nodes<\/p>\n<p><a class=\"fancybox\" id=\"img-13\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/13.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-12.png\" alt=\"Testing the setup\" width=\"500\" height=\"275\" title=\"\"><\/a><\/p>\n<p>All nodes are up &#8216;Online&#8217;.<\/p>\n<p>Test the corosync members.<\/p>\n<p class=\"command\">corosync-cmapctl | grep members<\/p>\n<p>You will get Corosync members IP address.<\/p>\n<p><a class=\"fancybox\" id=\"img-14\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/14.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-13.png\" alt=\"Corosync member IP addresses\" width=\"500\" height=\"266\" title=\"\"><\/a><\/p>\n<p>Check the Corosync members, and you will see the result as shown below.<\/p>\n<p class=\"command\">pcs status corosync<\/p>\n<p><a class=\"fancybox\" id=\"img-15\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/15.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-14.png\" alt=\"Corosync status\" width=\"500\" height=\"209\" title=\"\"><\/a><\/p>\n<p>And lastly, check the webserver High Availability. Open your web browser and type the Floating IP address &#8216;10.0.15.15&#8217;.<\/p>\n<p>You will see the web page from the &#8216;web01&#8217; server.<\/p>\n<p><a class=\"fancybox\" id=\"img-16\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/16.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-15.png\" alt=\"Website web01\" width=\"500\" height=\"100\" title=\"\"><\/a><\/p>\n<p>Next, stop the cluster on the &#8216;web01&#8217; server with the command below.<\/p>\n<p class=\"command\">pcs cluster stop web01<\/p>\n<p>And check again the page, and you will get the page from the &#8216;web02&#8217; server as below.<\/p>\n<p><a class=\"fancybox\" id=\"img-17\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/17.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-16.png\" alt=\"website web02\" width=\"500\" height=\"81\" title=\"\"><\/a><\/p>\n<p><strong>Additional:<\/strong><\/p>\n<p>Check the cluster status with the command below.<\/p>\n<p class=\"command\">pcs status<\/p>\n<p>And you will get the result as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-18\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_set_up_nginx_high_availability_with_pacemaker_corosync_on_centos_7\/big\/18.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-set-up-nginx-high-availability-with-pacemaker-and-corosync-on-centos-7-17.png\" alt=\"Check pcs status\" width=\"500\" height=\"243\" title=\"\"><\/a><\/p>\n<p>Setup of Nginx webserver High Availability with Pacemaker, Corosync, and Pcsd on CentOS 7 server has been completed successfully.<\/p>\n<h2 id=\"reference\">Reference<\/h2>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will guide you step by step on how to create a\u00a0High Availability Cluster Nginx Web Server with Pacemaker, Corosync, and Pcsd. We will create the Active-Passive Cluster or Failover-cluster Nginx web server using Pacemaker on a CentOS 7 system. Pacemaker is an open source cluster manager software that achieves maximum high &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-2179","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=2179"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2179\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=2179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=2179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=2179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}