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

Executive Summary
LAMP is an open source web server solution which is both powerful and stable that can
be used to create business applications. The acronym LAMP stands for Linux, Apache,
MySQL, and PHP/Perl/Python where Apache is the web server, MySQL the database,
and PHP/Perl/Python are server side scripting languages for creating dynamic web
pages. All these applications running on the open source OS, Linux, constitute the LAMP
stack.
Since the applications based on LAMP may be critical to a business, many customers
require that the LAMP components be “highly available”. HP Serviceguard for Linux can
be used to run these components in a cluster that has no single point of failure so that
application services are available despite hardware and software failure. This makes the
overall business application “Highly Available”.
This whitepaper describes how to use the existing HP Serviceguard for Linux contributed
toolkits to create a highly available and stable LAMP stack. This covers two configuration
options:
A Consolidated LAMP Configuration where both the web server and the
database always run on the same server
A Separate LAMP Configuration where the web server and the database run on
separate servers.
Introduction
With the maturity of the Linux Operating System, organizations today are looking to
deploy Linux for tasks that are more complex and more critical to their functioning. These
include system and network management, databases, project management tools, and
enterprise web applications. One such enterprise web application is the LAMP stack.
The individual components of the LAMP stack have been around for many years. But, the
collection of components is being increasingly viewed by vendors and customers as a
unified platform for building and running business applications. Such deployments
require that the applications be highly available and not be affected by a single point of
failure. The solution to this is to cluster multiple Linux servers together to build a highly
available environment.
HP Serviceguard for Linux is used to form a cluster of Linux servers and makes
application services available despite hardware or software failures or the planned
downtime required for maintenance or system upgrades. HP Serviceguard for Linux
monitors the LAMP stack and can respond to single or, sometimes, multiple failures within
the cluster. For example, when Serviceguard detects the failure of a node, it fails over
applications running on that node to other nodes in the cluster.
The existing Apache and MySQL toolkits for HP Serviceguard on Linux have been
leveraged to provide high availability to the LAMP components. This whitepaper
describes the procedure for setting up a highly available LAMP environment by using the
toolkits. The configuration instructions listed below are in addition to those in the Apache
and MySQL toolkit README’s. The instructions in the toolkit README’s must be followed
2