Sun Cluster Data Service for Apache Tomcat Guide for Solaris OS

ProcedureHow to Register and Configure Sun Cluster HA for Apache Tomcat as a Multiple Masters Data Service

This procedure assumes that you installed the data service packages during your initial Sun Cluster installation.

If you did not install the Sun Cluster HA for Apache Tomcat packages as part of your initial Sun Cluster installation, go to Installing the Sun Cluster HA for Apache Tomcat Packages.

  1. Become superuser or assume a role that provides solaris.cluster.modify and solaris.cluster.admin RBAC authorizations.

  2. Prepare the parameter file, which is required by the Sun Cluster HA for Apache Tomcat.

    # cd /opt/SUNWsctomcat/bin
    cp pfile desired place

    Edit the parameter file pfile and follow the comments within that file. For example:

    # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    # Use is subject to license terms.
    #ident   "@(#)pfile.ksh 1.2     06/03/08 SMI"
    # Set the Apache Tomcat specific environment variables which the start, stop
    # and check fuctions will use
    # EnvScript     Script to set runtime environment for tomcat
    # User          Apache Tomcat User
    # Basepath      Absolute path to Tomcat Home directory i.e. 4.x CATALINA_HOME
    #               or TOMCAT_HOME for 3.x
    # Host          Hostname to test Apache Tomcat
    # Port          Port where Apache Tomcat is configured
    # TestCmd       Apache Tomcat test command
    # Startwait     Sleeping $Startwait seconds aftercompletion of the
    #               start command
    TestCmd="get /index.jsp"

    The following is an example for Apache Tomcat 4.1.24.

    TestCmd="get /index.jsp"

    This example is from an Apache Tomcat 4.1.24 configured as standalone web server with the default start page index.jsp. The start page contains the string CATALINA.

    The Host parameter depends on the location of the pfile.

    • If the pfile is stored on the shared storage, you need to use localhost.

    • If the pfile is stored on the local storage, it can be either localhost or the nodes host name.

    Caution – Caution –

    The parameter files need to be available on every node that can host the Apache Tomcat data service. For a scalable or a multiple masters configuration, store them on the local file system of every node/none—global zone or on the shared storage. The parameter files must not differ for an instance of Apache Tomcat on the various nodes.

    Repeat this Step for every Apache Tomcat instance and every node you need.

  3. Create and register each required Apache Tomcat component.

    # cd /opt/SUNWsctomcat/util
    # cp sctomcat_config desired place

    Edit the sctomcat_config file and follow the comments within that file, for example:

    # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    # Use is subject to license terms.
    #ident   "@(#)sctomcat_config.ksh 1.2     06/03/08 SMI"
    # This file will be sourced in by sctomcat_register and the parameters
    # listed below will be used.
    # These parameters can be customized in (key=value) form
    #        RS - name of the resource for the application
    #        RG - name of the resource group containing RS
    #      PORT - name of the port number
    #        LH - name of the LogicalHostname SC resource
    #  SCALABLE - true for a scalable resource or false for a failover resource
    #   NETWORK - false or true, false for multiple master configurations without
    #             shared address, in this case SCALABLE will be ignored
    #     PFILE - absolute path to the parameter file for the Tomcat resource
    #    HAS_RS - name of the HAStoragePlus SC resource
    #             (it can be a , separated list for the dependencies)
    # The following variables need to be set only if the agent runs in a
    # local zone
    #      ZONE - the zone name where the Apache Tomcat should run in
    #             Optional
    #    ZONEBT - The resource name which controls the zone.
    #             Optional
    #   PROJECT - A project in the zone, that will be used for this service
    #             specify it if you have an su - in the start stop or probe,
    #             or to define the smf credentials. If the variable is not set,
    #             it will be translated as :default for the smf manifest
    #             Optional
    # local zone specific options

    The following is an example for Apache Tomcat.


    Omit the LH parameter here, it will not be used. Set the parameter HAS_RS only when another file system (GFS or local file system) is used and the appropriate Apache-Tomcat-has-resource is created. The ZONE, ZONE_BT and PROJECT variables are needed only if the multiple masters container resources are zones managed by the container agent.

  4. After editing sctomcat_config register the resource.

    # ksh ./sctomcat_register -f desired place/sctomcat_config

    Repeat Steps 7, 8, and 9 for every Apache Tomcat instance you need.

  5. Enable each Apache Tomcat resource.

    Repeat this step for each Apache Tomcat resource created in the previous step.

    # clresource status 

    # clresource enable Apache-Tomcat-resource