Go to main content

Oracle® Solaris Cluster Data Service for Apache Tomcat Guide

Exit Print View

Updated: June 2017
 
 

How to Install and Configure Apache Tomcat in a Failover Zone

  1. Determine how Apache Tomcat will be deployed in Oracle Solaris Cluster
    • Determine whether you will use Apache Tomcat as a failover or multiple-masters data service, or as a scalable data service.

      For conceptual information on scalable and failover data services, see Oracle Solaris Cluster 4.3 Concepts Guide.

    • Determine which user name will run Apache Tomcat.

    • Determine how many Apache Tomcat versions and instances will be deployed.

    • If more than one instance of a version will be deployed, determine whether they share the binaries.

    • Determine which Cluster File System will be used by each Apache Tomcat instance.

  2. Assume the root role or assume a role that provides solaris.cluster.modify and solaris.cluster.admin authorizations.
  3. Create user and group if required.

    If Apache Tomcat is to run under a non root user, you have to create the appropriate user and the appropriate group. For these tasks use the following commands.

    1. Create the group.
      # groupadd —g 1000 tomcat
    2. Create the user.
      # useradd —u 1000 —g 1000 —d /global/tomcat —s /bin/ksh tomcat
  4. If you are not logged in as root, switch to the appropriate user name.
    # su — user-name
  5. Install Apache Tomcat.

    If you deploy Apache Tomcat as a failover data service, install Apache Tomcat onto a shared file system or in a failover zone within Oracle Solaris Cluster.

    It is recommended that you install Apache Tomcat onto shared disks. For a discussion of the advantages and disadvantages of installing the software on a local versus a cluster file system, see Determining the Location of the Application Binaries in Oracle Solaris Cluster 4.3 Data Services Planning and Administration Guide.

    If you plan to deploy Apache Tomcat as a failover data service, install the Apache Tomcat binaries on the shared storage on one node or in the failover zone. If Apache Tomcat will be deployed as a multiple-masters data service, install the Apache Tomcat binaries on the local storage in every target zone that will host the Apache Tomcat data service.


    Note -  Refer to http://tomcat.apache.org/index.html for instructions about installing Apache Tomcat.

    If you deploy Apache Tomcat as a multiple-masters data service, repeat the following step at every node or target zone that will host Apache Tomcat.

  6. Create the environment script.

    Create a Korn shell or a C shell script (dependent on the login-shell of your Apache Tomcat user name) to set the environment variables for Apache Tomcat. You must set the environment variables in a shell script and not in the user's profile.

    With this mechanism you can install and run multiple Apache Tomcat versions and instances under one user name.


    Caution

    Caution  -  These shell scripts must be available on every zone that can host the Apache Tomcat data service. For a failover configuration, store them on the shared storage of the node or in the target zone. For a multiple-masters configuration, store them on the local file system or on the shared storage of the target zone. These scripts must be the same on the various zones. For an installation in a failover zone, any place where the Tomcat user has access is appropriate.


Example 3  Korn shell script to set the environment variables for Apache Tomcat 6.0.28
# more env.ksh
#!/usr/bin/ksh
#
# Environment for Tomcat
#
JAVA_HOME=/usr
export JAVA_HOME
CATALINA_HOME=/global/mnt1/jakarta-tomcat-6.0.28
export CATALINA_HOME
Example 4  C shell script to set the environment variables for Apache Tomcat 6.0.28
# more env.csh
#!/usr/bin/csh
#
# Environment for Tomcat
#
setenv JAVA_HOME /usr
setenv CATALINA_HOME /global/mnt1/jakarta-tomcat-6.0.28

The environment variables are version and configuration dependent.