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

Edit the package configuration file (lamp_single_pkg.config) and change the
PACKAGE_NAME and NODE_NAME fields according to the comments given in that file
template. The next set of editable fields in the package configuration file defines the path
to the package control file. Enter the path to the package control script for both the
RUN_SCRIPT and HALT_SCRIPT. In the package configuration file used in the
development of this white paper, these entries look as follows.
PACKAGE_NAME lamp_single
NODE_NAME node1
NODE_NAME node2
RUN_SCRIPT /usr/local/cmcluster/conf/http_pkg/lamp_single_pkg.cntl
RUN_SCRIPT_TIMEOUT NO_TIMEOUT
HALT_SCRIPT /usr/local/cmcluster/conf/http_pkg/lamp_single_pkg.cntl
HALT_SCRIPT_TIMEOUT NO_TIMEOUT
The following sets of fields define the service variables required to start monitor services
for both Apache and MySQL. Since in this configuration both Apache and MySQL run as
a consolidated stack both MySQL and Apache monitor services need to be listed in this
file. The sample field entries are shown below.
SERVICE_NAME http.monitor
SERVICE_FAIL_FAST_ENABLED NO
SERVICE_HALT_TIMEOUT 300
SERVICE_NAME mysql.monitor
SERVICE_FAIL_FAST_ENABLED NO
SERVICE_HALT_TIMEOUT 300
Next, edit the package control script (lamp_single_pkg.cntl). Other scripts from both
original toolkits are called from this package control script. In a typical package control
script, calls to the toolkit.sh file can be made in two ways. One way to do this is to
enable the HA_APP_SERVER variable. This causes Serviceguard to make a call to the
toolkit.sh file in the current directory, in this case the Apache package directory. This is
one of the reasons for keeping the package configuration file and the package control
file in the Apache package directory. Another way to call the toolkit.sh is by making
explicit calls in the customer defined run and halt command functions. Since explicit
paths can be used here, it is not mandatory for the toolkit.sh file to reside in the current
directory. This feature can be used for calling the toolkit.sh for MySQL.
The two calling methods shown above can be merged so that both Apache and MySQL
toolkit.sh files can be called from the same package control script and both services can
run as part of the same package.
Various lines in the package control script (lamp_single_pkg.cntl) need to change:
VGCHANGE="vgchange -a y"
VG[0] ="vg01"
VG[1] ="vg02"
Where, VG[0] specifies the volume group for the shared Apache DocumentRoot directory
and VG[1] is the volume group for the MySQL database and configuration files.
LV[0]="/dev/vg01/lvol0"; FS[0]="/Apache"; FS_TYPE[0]="ext3";
FS_MOUNT_OPT[0]="-o rw"
7