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

About Horizontal Scalability

Sun 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 Sun Cluster Concepts Guide for Solaris OS.

Before using the Sun 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.

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

Using Sun Cluster HA for Apache Tomcat in a purely scalable
configuration.

Using Sun Cluster HA for Apache Tomcat in a multiple
masters configuration.

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

A client accesses the scalable configuration by its shared address.
In this case, Sun Cluster does the load-balancing.

A client accesses a multiple masters configuration using each node's
physical address. Load-balancing must be done outside of the cluster.

Sun Cluster HA for Apache Tomcat as a scalable configuration

You can use Sun 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 –

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.

For Apache Tomcat 5.x, inbound memory session replication as a built-in
feature, is on the feature list.

For Apache Tomcat 3.x the inbound memory session replication is not
configurable.

Sun Cluster HA for Apache Tomcat as a multiple master
configuration

You can use Sun 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 hostnames.

Configuration Restrictions

This section provides a list of software and hardware configuration restrictions
that apply to Sun Cluster HA for Apache Tomcat only.

Deploy a scalable Sun 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.

Setting the resource parameter Load_balancing_policy to LB_STICKY is
strictly required, if Sun 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.

Caution –

Your data service configuration might not be supported if you do not
observe these restrictions.

Configuration Requirements

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

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 –

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.

Apache Tomcat Component Dependencies

You can configure the
Sun 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 3, in Table 4, or in Table 5.

Table 3 Dependencies Failover

Component

Description

Storage Resource

This resource can be a SUNW.HAStoragePlus or a SUNW.HAStorage resource type.

Apache Tomcat(Mandatory)

-> SUNW.HAStoragePlus resource or SUNW.HAStorage resource

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

Logical Host(Mandatory)

The Apache Tomcat has an implicit dependency on the logical hosts of the resource
group, because it is based on the generic data service. On behalf of this reason a
logical Host needs to exist, but no explicit dependency is necessary.

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 4.

Table 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 5.

Table 5 Dependencies Multiple Masters

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.