Product SiteDocumentation Site

Chapter 7. Add Apache HTTP Server as a Cluster Service

Table of Contents

7.1. Install Apache
7.2. Create Website Documents
7.3. Enable the Apache status URL
7.4. Configure the Cluster
7.5. Ensure Resources Run on the Same Host
7.6. Ensure Resources Start and Stop in Order
7.7. Prefer One Node Over Another
7.8. Move Resources Manually
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.

7.1. Install Apache

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.
# yum install -y httpd wget
# firewall-cmd --permanent --add-service=http
# firewall-cmd --reload

Important

Do not enable the httpd service. Services that are intended to be managed via the cluster software should never be managed by the OS. 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.