JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Cluster Data Service for Apache Tomcat Guide     Oracle Solaris Cluster
search filter icon
search icon

Document Information

Preface

1.  Installing and Configuring Oracle Solaris Cluster HA for Apache Tomcat

Installing and Configuring Oracle Solaris Cluster HA for Apache Tomcat

Oracle Solaris Cluster HA for Apache Tomcat

Planning the Oracle Solaris Cluster HA for Apache Tomcat Installation and Configuration

Apache Tomcat and Solaris Containers

About Horizontal Scalability

Oracle Solaris Cluster HA for Apache Tomcat as a scalable configuration

Oracle Solaris Cluster HA for Apache Tomcat as a multiple master configuration

Configuration Restrictions

Restriction to deploy Oracle Solaris Cluster HA for Apache Tomcat in a scalable configuration

Restriction for the Load_balancing_policy

Restriction for Scalable Services and Solaris Containers

Restriction for the Apache Tomcat smf Service Name in a Failover Zone

Restriction for Apache Tomcat 5.5.28, 6.0.29, and 7.06

Configuration Requirements

Location of the Tomcat Home Directory for Scalable or Multiple Masters Configurations

Load Balancing for Multiple Master Configurations

Location of the Tomcat Home Directory for Failover Configurations

Location of the wget Command for Apache Tomcat 5.5.28, 6.0.29, and 7.06

Apache Tomcat Component Dependencies

Apache Tomcat Configuration and Registration Files

Installing and Configuring Apache Tomcat

How to Enable Apache Tomcat to run in a Global Zone Configuration

How to Install and Configure Apache Tomcat in the Global Zone

How to Enable Apache Tomcat to run in a Zone Configuration

How to Install and Configure Apache Tomcat in a Zone

How to Enable Apache Tomcat to run in Failover Zone Configuration

How to Install and Configure Apache Tomcat in a Failover Zone

Verifying the Installation and Configuration of Apache Tomcat

How to Verify the Installation and Configuration of Apache Tomcat

How to Deploy the Apache Tomcat Application

Installing the HA for Apache Tomcat Packages

How to Install the HA for Apache Tomcat Packages

Registering and Configuring Oracle Solaris Cluster HA for Apache Tomcat

How to Register and Configure Oracle Solaris Cluster HA for Apache Tomcat as a Failover Data Service

How to Register and Configure Oracle Solaris Cluster HA for Apache Tomcat as a Multiple Masters Data Service

How to Register and Configure Oracle Solaris Cluster HA for Apache Tomcat as a Scalable Data Service

Configuring Oracle Solaris Cluster HA for Apache Tomcat in Zones

Configuring Oracle Solaris Cluster HA for Apache Tomcat in a Failover Zone

How to Register Oracle Solaris Cluster HA for Apache Tomcat in a Failover Zone

How to Modify Parameters in the Oracle Solaris Cluster HA for Apache Tomcat Manifest

How to Remove a Oracle Solaris Cluster HA for Apache Tomcat Resource From a Failover Zone

Configuring Oracle Solaris Cluster HA for Apache Tomcat in a Zone

How to Register Oracle Solaris Cluster HA for Apache Tomcat in a Zone

Verifying the Oracle Solaris Cluster HA for Apache Tomcat Installation and Configuration

How to Verify the Oracle Solaris Cluster HA for Apache Tomcat Installation and Configuration

Understanding the Oracle Solaris Cluster Apache Tomcat HA Parameter File

Structure of the Apache Tomcat HA parameter file

Strategy to Choose the TestCmd and the ReturnString Variable

Understanding Oracle Solaris Cluster HA for Apache Tomcat Fault Monitor

Resource Properties

Probing Algorithm and Functionality

Debugging HA for Apache Tomcat

How to Activate Debugging for HA for Apache Tomcat

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

B.  Deployment Example: Installing Apache Tomcat in a Failover Zone

C.  Deployment Example: Installing Apache Tomcat in a Non-Global Zone

Index

Planning the Oracle Solaris Cluster HA for Apache Tomcat Installation and Configuration

This section contains the information you need to plan your Oracle Solaris Cluster HA for Apache Tomcat installation and configuration.

Apache Tomcat and Solaris Containers

Oracle Solaris Cluster HA for Apache Tomcat is supported in Solaris Containers, Oracle Solaris Cluster is offering two concepts for Solaris Containers.

About Horizontal Scalability

Oracle Solaris Cluster includes a concept of horizontal scalability for data services called scalable service. IP based load-balancing algorithms are integrated in this concept. Because of this reason you can scale horizontally without using hardware loadbalancers. For a more detailed discussion of this scalable service see Oracle Solaris Cluster Concepts Guide.

Before using the Oracle Solaris Cluster HA for Apache Tomcat in a scalable configuration, it is necessary to have a closer look at the infrastructure of the cluster and the clients.

If your clients access your application using proxies, determine whether the used proxy stays the same during a session context. This is true for an intranet.

If the proxy changes during a session context it means, from the load-balancing point of view, that the source IP address is changing. This will spoil every IP based load-balancing, wether it is hardware or software.

Especially when your client accesses the server over the Internet, it is not guaranteed, that the source IP address remains the same during a session context.

Oracle Solaris Cluster HA for Apache Tomcat can be configured two ways to get horizontal scalability.

  1. Using Oracle Solaris Cluster HA for Apache Tomcat in a purely scalable configuration.

  2. Using Oracle Solaris Cluster HA for Apache Tomcat in a multiple masters configuration.

The difference between the two configuration is in the way of accessing the nodes.

For more information about scalable data services, see Oracle Solaris Cluster Concepts Guide.

Both configuration options are discussed in the sectionsOracle Solaris Cluster HA for Apache Tomcat as a scalable configuration and Oracle Solaris Cluster HA for Apache Tomcat as a multiple master configuration.

Oracle Solaris Cluster HA for Apache Tomcat as a scalable configuration

You can use Oracle Solaris Cluster HA for Apache Tomcat in a scalable configuration if it is guaranteed, that the source IP address remains the same during a session context. This guarantee is achieved in example in an intranet.

If the source IP address might change during a session context and a scalable configuration is required, Apache Tomcat needs to be configured with session replication. This can be done by the application using a global file system or a database.


Caution

Caution - You will get a performance penalty from this approach.


You will get better performance using Tomcats inbound memory session replication for a scalable configuration with changing source IP addresses.

Oracle Solaris Cluster HA for Apache Tomcat as a multiple master configuration

You can use Oracle Solaris Cluster HA for Apache Tomcat in a multiple master configuration in the other scenarios. External load-balancing is required. A typical configuration uses the scalable Apache web server as a load balancer and configures one physical host name of an Apache Tomcat instance behind each instance of the Apache web server. Another option is to use a hardware load balancer, which handles the session context.

The difference between scalable and multiple masters configuration is only in the way, the clients access the cluster nodes. In a scalable configuration, they access the shared address. Otherwise the clients access the physical zone or hostnames.

Configuration Restrictions

The configuration requirements in this section apply only to Apache Tomcat.


Caution

Caution - If your data service configuration does not conform to these requirements, the data service configuration might not be supported.


Restriction to deploy Oracle Solaris Cluster HA for Apache Tomcat in a scalable configuration

Deploy a scalable Oracle Solaris Cluster HA for Apache Tomcat configuration only if either session replication, or reliable source IP addresses are achieved. Otherwise the behavior of the application becomes unpredictable.

Restriction for the Load_balancing_policy

Setting the resource parameter Load_balancing_policy to LB_STICKY is strictly required, if Oracle Solaris Cluster HA for Apache Tomcat is deployed in a scalable configuration with reliable source IP addresses when no session replication is configured. Otherwise, the behavior of the application becomes unpredictable. In every other scalable configuration the Sticky Load_balancing_policy helps to get the more cache hits out of your caches.

Restriction for Scalable Services and Solaris Containers

Oracle Solaris Cluster HA for Apache Tomcat can be deployed in scalable configurations in Solaris Containers only if you use the zone features of Oracle Solaris Cluster.

Restriction for the Apache Tomcat smf Service Name in a Failover Zone

The Apache Tomcat configuration in a failover zone uses the smf component of Oracle Solaris Cluster HA for Solaris Containers. The registration of the Apache Tomcatdata service in a failover zone defines an smf service to control the Apache Tomcat database. The name of this smf service is generated in this naming scheme: svc:/application/sczone-agents:resource-name. No other smf service with exactly this name can exist.

The associated smf manifest is automatically created during the registration process in this location and naming scheme: /var/svc/manifest/application/sczone-agents/resource-name.xml. No other manifest can coexist with this name.

Restriction for Apache Tomcat 5.5.28, 6.0.29, and 7.06

Starting with Apache Tomcat versions 5.5.28, 6.0.29, and 7.06, you must use the wget probe algorithm. This bypasses the normal probe, enabling the TestUrl parameter to work correctly. You can choose to use the wget probe algorithm for earlier Apache Tomcat versions, or continue to use the original mconnect probe algorithm.

Configuration Requirements

These requirements apply to Oracle Solaris Cluster HA for Apache Tomcat only. You must meet these requirements before you proceed with your Oracle Solaris Cluster HA for Apache Tomcat installation and configuration.


Caution

Caution - Your data service configuration might not be supported if you do not adhere to these requirements.


Location of the Tomcat Home Directory for Scalable or Multiple Masters Configurations

If you intend to install Apache Tomcat in a scalable resource group, create the Tomcat Home directory and its dynamic data on local storage.

This required because Apache Tomcat uses the directory structure to store its configuration, logs, deployed applications and so on.

If your local storage is not big enough, you can use a Global File System on the shared storage.


Caution

Caution - In this scenario, the deployment of Tomcat applications needs to occur on every node where Apache Tomcat is hosted.


Load Balancing for Multiple Master Configurations

If you intend to install Apache Tomcat in a multiple master configuration, an external load balancer is required.

Location of the Tomcat Home Directory for Failover Configurations

If you intend to install Apache Tomcat in a failover resource group, create the Tomcat Home directory on the shared storage. The location for the Tomcat Home directory can reside on a Global File System (GFS) or it can reside on a Failover File System (FFS) with an HAStoragePlus resource. It is best practice to store it on a FFS.

This is required because Apache Tomcat uses the directory structure to store its configuration, logs, deployed applications, and so on. It is not recommended to store the binaries local and the dynamic parts of the data on the shared storage.


Note - It is best practice to mount Global File Systems with the /global prefix and to mount Failover File Systems with the /local prefix.


Location of the wget Command for Apache Tomcat 5.5.28, 6.0.29, and 7.06

To support the wget probe algorithm for Apache Tomcat 5.5.28, 6.0.29, and 7.06, the wget command must be available from every node of the cluster.

Apache Tomcat Component Dependencies

You can configure the Oracle Solaris Cluster HA for Apache Tomcat data service to protect one or more Apache Tomcat instances. Each instance needs to be covered by one Apache Tomcat resource. The dependencies between the Apache Tomcat resource and other needed resources are described in Table 1-3, Table 1-4, Table 1-5, or Table 1-6.

Table 1-3 Dependencies Between HA for Apache Tomcat Components in Failover Configurations

Component
Dependency
Apache Tomcat resource in the global zone or a zone.
SUNW.HAStoragePlus This dependency is required only, if the configuration uses a failover file system or file systems in a zone.

SUNW.LogicalHostName

Apache Tomcat resource in a failover zone.
Oracle Solaris Cluster HA for the Solaris Container boot resource.

SUNW.HAStoragePlus

SUNW.LogicalHostName — This dependency is required only if the zones boot resource does not manage the zone's IP address.

Because of the special requirements of a scalable configuration, you need no dependencies to storage or addresses, as long as every Apache Tomcat and its parameter file pfile is stored on the root file system. Otherwise follow Table 1-4.

Table 1-4 Dependencies Scalable

Component
Description
Storage Resource
This resource can be a SUNW.HAStorage or a SUNW.HAStoragePlus resource type.
Apache Tomcat(Mandatory)
→ Storage resource

The Storage resource manages the Apache Tomcat File System Mount points and ensures that Apache Tomcat is not started until they are mounted.

Shared address(Mandatory)
The shared address resource resides in a separate resource group on which the scalable resource group depends.

A multiple master configuration is running on more than one nodes like a scalable configuration, but without a shared address. Because of the special requirements of a multiple masters configuration, you need no dependencies to storage or addresses, as long as every Apache Tomcat and its parameter file pfile is stored on the root file system. Otherwise follow Table 1-5.

Table 1-5 Dependencies Between HA for Apache Tomcat Components in Failover Configurations

Component
Dependency
Apache Tomcat resource in the global zone
SUNW.HAStoragePlus. This dependency is required only, if the configuration uses a failover file system.
Apache Tomcat resource in a failover zone.
Oracle Solaris Cluster HA for the Solaris Container boot resource.

SUNW.HAStoragePlus.

If more elaborate dependencies are required, see the r_properties(5) and rg_properties(5) man pages for further dependencies and affinities settings.


Note - For more detailed information about Apache Tomcat, refer to the http://jakarta.apache.org web page.


A SUNW.HAStoragePlus resource requires a Resource_offline_restart dependency type, while all other resources require a strong dependency type called Resource_dependencies. You must define the Resource_offline_restart dependency for the SUNW.HAStoragePlus resource if the resource type version is at least version 9. See Table 1-6 for the dependency type needed for each resource. The following resources are examples and you should evaluate the dependency to other resources on a case-by-case basis.

Table 1-6 Dependency Types for HA for Apache Tomcat Resources

Resource Name
Dependency Type
SUNW.HAStoragePlus
Resource_offline_restart
SUNW.HAStorage
Resource_dependencies
SUNW.LogicalHostName
Resource_dependencies

Apache Tomcat Configuration and Registration Files

Apache Tomcat component has configuration and registration files in the directory /opt/SUNWsctomcat/util . These files let you register the Apache Tomcat component with Oracle Solaris Cluster.

Within these files, the appropriate dependencies have been applied.

# cd /opt/SUNWsctomcat
# 
# ls -l util
total 4
-rwx--x---   1 root     other        709 Apr 29 11:57 sctomcat_config
-rwx--x---   1 root     other        561 Apr 29 11:58 sctomcat_register
# more util/*g
::::::::::::::
util/sctomcat_config
::::::::::::::
#
# Copyright 2006, 2010, Oracle and/or its affiliates.  All rights reserved.
#

#ident   "@(#)sctomcat_config.ksh 1.2     06/03/08"

# 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

RS=
RG=
PORT=
LH=
NETWORK=false
SCALABLE=false
PFILE=
HAS_RS=

# local zone specific options

ZONE=
ZONE_BT=
PROJECT=