Sun Cluster Data Service for Apache Tomcat Guide for Solaris OS

Appendix A Deployment Example: Installing Apache Tomcat in the Global Zone

This appendix presents a complete example of how to install and configure the Apache Tomcat application and data service in the global zone. It presents a simple two-node cluster configuration. If you need to install the application in any other configuration, refer to the general-purpose procedures presented elsewhere in this manual. For an example of Apache Tomcat installation in a non-global zone, see Appendix B, Deployment Example: Installing Apache Tomcat in a Failover Zone or Appendix C, Deployment Example: Installing Apache Tomcat in a Non-Global Zone according to your zone type.

Target Cluster Configuration

This example uses a two-node cluster with the following node names:

This configuration also uses the logical host name ha-host-1.

Software Configuration

This deployment example uses the following software products and versions:

This example assumes that you have already installed and established your cluster. It illustrates installation and configuration of the data service application only.

Note –

The steps for installing Apache Tomcat in a cluster that runs on Solaris version 9 OS are identical to the steps in this example.


The instructions in this example were developed with the following assumptions:

Installing and Configuring Apache Tomcat on Global Storage in the Global Zone

The tasks you must perform to install and configure Apache Tomcat in the global zone are as follows:

ProcedureExample: Preparing the Cluster for Apache Tomcat

  1. Install and configure the cluster as instructed in Sun Cluster Software Installation Guide for Solaris OS.

    Install the following cluster software components on both nodes.

    • Sun Cluster core software

    • Sun Cluster data service for Apache Tomcat

  2. Beginning on the node that owns the file system, add the tomcat user.

    phys-schost-1# groupadd -g 1000 tomcat
    phys-schost-2# groupadd -g 1000 tomcat
    phys-schost-1# useradd -g 1000 -d /global/mnt3/tomcat -m -s /bin/ksh tomcat
    phys-schost-2# useradd -g 1000 -d /global/mnt3/tomcat -m -s /bin/ksh tomcat

ProcedureExample: Configuring Cluster Resources for Apache Tomcat

  1. Register the necessary data types on both nodes.

    phys-schost-1# clresourcetype register SUNW.gds SUNW.HAStoragePlus
  2. Create the Apache Tomcat resource group.

    phys-schost-1# clresourcegroup create RG-TOM
  3. Create the logical host.

    phys-schost-1# clreslogicalhostname create -g RG-TOM ha-host-1
  4. Create the HAStoragePlus resource in the RG-TOM resource group.

    phys-schost-1# clresource create -g RG-TOM -t SUNW.HAStoragePlus -p AffinityOn=TRUE \
    -p FilesystemMountPoints=/global/mnt3,/global/mnt4 RS-TOM-HAS
  5. Enable the resource group.

    phys-schost-1# clresourcegroup online -M RG-TOM

ProcedureExample: Installing the Apache Tomcat Software on Shared Storage

These steps illustrate how to install the Apache Tomcat software in the directory /global/mnt3/tomcat. As long as only one node is mentioned it needs to be the node where your resource group is online.

  1. Install the Apache Tomcat binaries on.

    phys-schost-1# su - tomcat
    phys-schost-1# gzcat apache-tomcat-5.5.17.tar.gz|tar xvf -
    phys-schost-1# gzcat apache-tomcat-5.5.17-compat.tar.gz|tar xvf -
  2. Create your environment script /global/mnt3/tomcat/env.kshwith the following contents.

    cat env.ksh 

ProcedureExample: Modifying the Apache Tomcat Configuration Files

  1. Copy the Apache Tomcat configuration file from the agent directory to its deployment location.

    phys-schost-1# cp /opt/SUNWsctomcat/util/sctomcat_config /global/mnt3
    phys-schost-1# cp /opt/SUNWsctomcat/bin/pfile /global/mnt3
    phys-schost-1# chown tomcat:tomcat /global/mnt3/pfile
  2. Add this cluster's information to the sctomcat_config configuration file.

    The following listing shows the relevant file entries and the values to assign to each entry.

  3. Save and close the file.

  4. Add this cluster's information to the parameter file /global/mnt3/pfile.

    The following listing shows the relevant file entries and the values to assign to each entry.

    TestCmd="get /index.jsp"
  5. Save and close the file.

ProcedureExample: Enabling the Apache Tomcat Software to Run in the Cluster

  1. Run the sctomcat_register script to register the resource.

    phys-schost-1# ksh /opt/SUNWsctomcat/util/sctomcat_register \
    -f /global/mnt3/sctomcat_config
  2. Enable the resource.

    phys-schost-1# clresource enable RS-TOM