Chapter 2. An active/passive Apache HTTP Server in a Red Hat High Availability Cluster
pcsto configure cluster resources. In this use case, clients access the Apache HTTP server through a floating IP address. The web server runs on one of two nodes in the cluster. If the node on which the web server is running becomes inoperative, the web server starts up again on the second node of the cluster with minimal service interruption.
Figure 2.1. Apache in a Red Hat High Availability Two-Node Cluster
- A two-node Red Hat High Availability cluster with power fencing configured for each node. This procedure uses the cluster example provided in Chapter 1, Creating a Red Hat High-Availability Cluster with Pacemaker.
- A public virtual IP address, required for Apache.
- Shared storage for the nodes in the cluster, using iSCSI or Fibre Channel.
- Configure an
ext4file system mounted on the logical volume
my_lv, as described in Section 2.1, “Configuring an LVM Volume with an ext4 File System”.
- Configure a web server, as described in Section 2.2, “Web Server Configuration”.
- Ensure that only the cluster is capable of activating the volume group that contains
my_lv, and that the volume group will not be activated outside of the cluster on startup, as described in Section 2.3, “Exclusive Activation of a Volume Group in a Cluster”.
2.1. Configuring an LVM Volume with an ext4 File System
ext4file system on that volume. In this example, the shared partition
/dev/sdb1is used to store the LVM physical volume from which the LVM logical volume will be created.
/dev/sdb1partition is storage that is shared, you perform this procedure on one node only,
- Create an LVM physical volume on partition
pvcreate /dev/sdb1Physical volume "/dev/sdb1" successfully created
- Create the volume group
my_vgthat consists of the physical volume
vgcreate my_vg /dev/sdb1Volume group "my_vg" successfully created
- Create a logical volume using the volume group
lvcreate -L450 -n my_lv my_vgRounding up size to full physical extent 452.00 MiB Logical volume "my_lv" createdYou can use the
lvscommand to display the logical volume.
lvsLV VG Attr LSize Pool Origin Data% Move Log Copy% Convert my_lv my_vg -wi-a---- 452.00m ...
- Create an
ext4file system on the logical volume
mkfs.ext4 /dev/my_vg/my_lvmke2fs 1.42.7 (21-Jan-2013) Filesystem label= OS type: Linux ...