Product SiteDocumentation Site

Chapter 6. Add Apache HTTP Server as a Cluster Service

Table of Contents

6.1. Install Apache
6.2. Create Website Documents
6.3. Enable the Apache status URL
6.4. Configure the Cluster
6.5. Ensure Resources Run on the Same Host
6.6. Ensure Resources Start and Stop in Order
6.7. Prefer One Node Over Another
6.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.

6.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.