Using HP Serviceguard for Linux to Provide High Availability for LAMP, December 2005

Approach
The existing Toolkits for Apache and MySQL have been leveraged to package the LAMP
setup with HP Serviceguard for Linux. The Apache and MySQL toolkits for HP
Serviceguard for Linux consist of sets of shell scripts that startup, shutdown and monitor
the Apache web server and the MySQL database applications. These two toolkits can be
used to simplify the packaging of Apache and MySQL with HP Serviceguard for Linux. In
the LAMP “Separate packages” configuration, these toolkits are employed as is. For the
single package configuration however, one package is created that is common to both
Apache and MySQL. This common package control script employs components from
both the Apache and MySQL toolkits to start, monitor, and stop the respective services.
High availability for Consolidated LAMP configuration
Figure 1: Apache and MySQL running as part of the same package in a Consolidated LAMP configuration
In the Consolidated LAMP configuration, MySQL database and the Apache Web Server
(with PHP) always run on the same server node in the cluster, where Serviceguard
continually monitors the health of these applications and also the node on which these
applications run. On detecting a failure of any application or in the case of a node
failure, both applications fail over to the alternate (adoptive) machine.
Here, Apache with PHP enabled and MySQL run on a single machine as a single
Serviceguard for Linux package. If either one or both of these applications fails or if the
node goes down, then both the applications switch to an alternate node. Such a
configuration is the easiest to control.
Pk
g
A
Web Contents
Apache
+
MySQL
Se
rv
e
r
B
Se
rv
e
r
A
4