Multiple Tomcat Instances Configuration

Tomcat servlet engine is a multi-instance application. More than one instance of the Tomcat can run on a single node simultaneously. For example, if two nodes are each running an instance of Tomcat and one node fails, the Tomcat instance on the failed node can be successfully failed over to the healthy node. In addition, the healthy node can continue to run its own instance as well. Multiple Tomcat instance configuration can either be done as a local configuration or shared configuration or a combination of both. CATALINA_BASE needs to be unique for each Tomcat instance.

Configuring the Tomcat server with Serviceguard

To manage a Tomcat Server with Serviceguard, the default Tomcat configuration needs to be modified. Before creating and configuring Serviceguard packages, make sure that the following configurations have been completed for the Tomcat Server application for all cluster nodes:

When the Tomcat Server is installed, the default instance may be automatically configured to be started during system startup via the runlevel (rc) script "hpws22_tomcatconf" in the /etc/rc.config.d/ directory by setting "HPWS22_TOMCAT_START=1". Make sure this is disabled by setting "HPWS22_TOMCAT_START=0".

The connector component to be used is defined as an element in the Tomcat server configuration file server.xml. The connector component has a port attribute that needs to be unique for each Tomcat instance.

NOTE: The default server configuration file is available at /opt/hpws22/tomcat/conf/ server.xml. If WSS 2.x is installed it will be installed at /opt/hpws22/tomcat/conf/ server.xml.

The default installation for Tomcat is set to automatic start, when configuring Tomcat with Serviceguard this should be disabled.

Create a separate, distinct CATALINA_BASE directory for each Tomcat Serviceguard package.

Configure all Tomcat instances to listen to package relocatable IP addresses. (Refer to the Tomcat Server documentation for detailed information on configuring virtual hosts.)

For a local configuration, install and configure the Tomcat in the same location on the primary and all backup nodes and set up identical (or equivalent) configuration files in the same server root directory on all nodes. Also, all web application directories must exist on all nodes and should contain identical files.

Shared Configuration

For a shared configuration, typically configure web application directories on a shared file system. Note that one or more shared file systems may be used. Ensure all required components that are on shared storage will be available at the same time. (It is not mandatory to place the CATALINA_BASE directory on a shared file system in order to make use of shared storage. Choose a local CATALINA_BASE directory for configuration files and place only the web application directories on a shared file system. However, configure identical CATALINA_BASE directories and identical configuration files on all nodes.)

1.Using LVM

To configure a shared file system which is managed by LVM, create volume group(s) and logical volume(s) on the shared disks and construct a new file system for each logical volume for the Tomcat Server web applications (and CATALINA_BASE).

Static web data such as web pages with no data update features, may reside on a local disk. However, all web data that needs to be shared must reside on shared storage. This data may contain dynamic data generated and updated by a client's HTTP POST request.

Multiple Tomcat Instances Configuration 113