Skip Navigation Links | |
Exit Print View | |
![]() |
Oracle Solaris Cluster Data Service for Apache Tomcat Guide Oracle Solaris Cluster |
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
Oracle Solaris Cluster HA for Apache Tomcat as a scalable configuration
Oracle Solaris Cluster HA for Apache Tomcat as a multiple master configuration
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
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 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
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
This section contains the procedures you need to configure Oracle Solaris Cluster HA for Apache Tomcat.
This procedure assumes that you installed the data service packages.
If you did not install the Oracle Solaris Cluster HA for Apache Tomcat packages, go to Installing the HA for Apache Tomcat Packages.
It is assumed that the file system of Apache Tomcat will be mounted as a failover file system.
# cd /opt/SUNWsctomcat/bin # cp pfile desired-place
Edit the parameter file pfile and follow the comments within that file. For example:
#!/usr/bin/ksh # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the License). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/CDDL.txt # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/CDDL.txt. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets \[\] replaced with your own identifying # information: Portions Copyright \[yyyy\] \[name of copyright owner\] # # CDDL HEADER END # # # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # #ident "@(#)pfile.ksh 1.6 10/08/16" # 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 # # Some versions of Apache Tomcat do not react on the probe algorithm with the # http get command. Because of this we provide an alternative probe method # which uses wget. If wget is not installed on your system you must install it # manually and provide the WgetPath variable. If the WgetPath variable is not set, # it defaults to /usr/sfw/bin/wget. # You can use the wget algorithm for https probe as well which are not possible # with the http get command. # # Use the variables TestUrl and WgetPath as a replacement for: # Port, Host, TestCmd # You can specify only one set of variables. # # TestUrl Url where Tomcat serves a web site. This can be done either # by the http or https protocol # Format: http://hostname:port/startpage # Example: http://localhost:8080/ # You might want to include options here like: # "--no-cookies http://localhost:8080/" # The requirement here is that wget -O - ${TestUrl} produces # the output containing the ReturnString. # WgetPath Abolute path to wget, leaving this variable empty defaults to: # /usr/sfw/bin/wget # Startwait Sleeping $Startwait seconds after completion of the # start command # ReturnString This string must be present in the output of the http get command # or in the output of the wget command. EnvScript= User= Basepath= Host= Port=8080 TestCmd="get /index.jsp" TestUrl= WgetPath= ReturnString="CATALINA" Startwait=20
The following is an example for Apache Tomcat 4.1.24.
EnvScript=/global/mnt1/tomtest/env.ksh User=tomtest Basepath=/global/mnt1/tomtest/jakarta-tomcat-4.1.24 Host=tomcat-lh Port=8080 TestCmd="get /index.jsp" TestUrl= WgetPath= ReturnString="CATALINA" Startwait=20
This example for Apache Tomcat 4.1.24 configures a standalone web server with the default start page index.jsp. The start page contains the string CATALINA.
To use the alternative wget probe, assuming wget is available under /usr/sfw/bin/wget, instead set the following variables:
EnvScript=/global/mnt1/tomtest/env.ksh User=tomtest Basepath=/global/mnt1/tomtest/jakarta-tomcat-4.1.24 Host= Port= TestCmd= TestUrl="http://tomcat-lh:8080/" WgetPath= ReturnString="CATALINA" Startwait=20
![]() | Caution - The parameter files must be available on every node that can host the Apache Tomcat data service. For a scalable or multiple-masters configuration, store the parameter files on the local file system of every node or non-global zone or on the shared storage. The parameter files cannot differ for any instance of Apache Tomcat on the various nodes. |
Repeat Step 1 for every Apache Tomcat instance you need.
# cd /opt/SUNWsctomcat/util # cp sctomcat_config desired place
Edit the sctomcat_config file and follow the comments within that file. For example:
# # Copyright (c) 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=
The following is an example for Apache Tomcat.
RS=tomcat-res RG=tomcat-rg PORT=8080 LH=tomcat-lh SCALABLE=false PFILE=/global/mnt1/pfile NETWORK=true HAS_RS=tomcat-hastplus-res
# ksh ./sctomcat_register -f desired place/sctomcat_config
Repeat Step 9,10, and 11 for each Apache Tomcat instance you need.
Repeat this step for each Apache Tomcat resource created in the step 10.
# clresource status
# clresource enable Apache-Tomcat-resource
This procedure assumes that you installed the data service packages during your initial Oracle Solaris Cluster installation.
If you did not install the Oracle Solaris Cluster HA for Apache Tomcat packages as part of your initial Oracle Solaris Cluster installation, go to Installing the HA for Apache Tomcat Packages.
# cd /opt/SUNWsctomcat/util # cp sctomcat_config desired-place
Edit the parameter file and follow the comments within that file. For example:
#!/usr/bin/ksh # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the License). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/CDDL.txt # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/CDDL.txt. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets \[\] replaced with your own identifying # information: Portions Copyright \[yyyy\] \[name of copyright owner\] # # CDDL HEADER END # # # # # Copyright (c) 2006,2010, Oracle and/or its affiliates. All rights reserved. # # #ident "@(#)pfile.ksh 1.6 10/08/16" # 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 # # Some versions of Apache Tomcat do not react on the probe algorithm with the # http get command. Because of this we provide an alternative probe method # which uses wget. If wget is not installed on your system you must install it # manually and provide the WgetPath variable. If the WgetPath variable is not set, # it defaults to /usr/sfw/bin/wget. # You can use the wget algorithm for https probe as well which are not possible # with the http get command. # # Use the variables TestUrl and WgetPath as a replacement for: # Port, Host, TestCmd # You can specify only one set of variables. # # TestUrl Url where Tomcat serves a web site. This can be done either # by the http or https protocol # Format: http://hostname:port/startpage # Example: http://localhost:8080/ # You might want to include options here like: # "--no-cookies http://localhost:8080/" # The requirement here is that wget -O - ${TestUrl} produces # the output containing the ReturnString. # WgetPath Abolute path to wget, leaving this variable empty defaults to: # /usr/sfw/bin/wget # Startwait Sleeping $Startwait seconds after completion of the # start command # ReturnString This string must be present in the output of the http get command # or in the output of the wget command.EnvScript= EnvScript= User= Basepath= Host= Port=8080 TestCmd="get /index.jsp" TestUrl= WgetPath= ReturnString="CATALINA" Startwait=20
The following is an example for Apache Tomcat 4.1.24.
EnvScript=/tomcat/env.ksh User=tomcat Basepath=/tomcat/jakarta-tomca-4.1.24 Host=localhost Port=8080 TestCmd="get /index.jsp" TestUrl= WgetPath= ReturnString="CATALINA" Startwait=20
This example for Apache Tomcat 4.1.24 configures a standalone web server with the default start page index.jsp. The start page contains the string CATALINA.
Depending on the selected probe method, the Host parameter or the IP alias in the TestUrl parameter depends on the location of the pfile:
If the pfile is stored on the shared storage, you must use localhost.
If the pfile is stored on the local storage, it can be either localhost or the node's host name.
To use the alternative wget probe, assuming wget is available under /usr/sfw/bin/wget, set the following variables:
EnvScript=/global/mnt1/tomtest/env.ksh User=tomtest Basepath=/global/mnt1/tomtest/jakarta-tomcat-4.1.24 Host= Port= TestCmd= TestUrl="http://localhost:8080/" WgetPath= ReturnString="CATALINA" Startwait=20
![]() | Caution - The parameter files must be available on every node that can host the Apache Tomcat data service. For a scalable or a multiple-masters configuration, store the parameter files on the local file system of every node or non-global zone or on the shared storage. The parameter files must not differ for any instance of Apache Tomcat on the various nodes. |
Repeat this Step for every Apache Tomcat instance and every node you need.
# 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, 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=
The following is an example for Apache Tomcat.
RS=tomcat-res RG=tomcat-rg PORT=8080 LH=tomcat-lh SCALABLE=false SNETWORK=falsePFILE=/local/pfile HAS_RS=Apache-Tomcat-has-resource
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.
# ksh ./sctomcat_register -f desired place/sctomcat_config
Repeat Steps 7, 8, and 9 for every Apache Tomcat instance you need.
Repeat this step for each Apache Tomcat resource created in the previous step.
# clresource status
# clresource enable Apache-Tomcat-resource
This procedure assumes that you installed the data service packages during your initial Oracle Solaris Cluster installation.
If you did not install the Oracle Solaris Cluster HA for Apache Tomcat packages as part of your initial Oracle Solaris Cluster installation, go to Installing the HA for Apache Tomcat Packages.
# cd /opt/SUNWsctomcat/bin cp pfile desired-place
Edit the parameter file pfile and follow the comments within that file. For example:
#!/usr/bin/ksh # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the License). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/CDDL.txt # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/CDDL.txt. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets \[\] replaced with your own identifying # information: Portions Copyright \[yyyy\] \[name of copyright owner\] # # CDDL HEADER END # # # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # #ident "@(#)pfile.ksh 1.6 10/08/16" # Set the Apache Tomcat specific environment variables which the start, # stop and check functions will use # # EnvScript Script to set runtime environment for tomcat # User Apache Tomcat user name # Basepath Absolute pathname 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 # # # Some versions of Apache Tomcat do not react on the probe algorithm with the # http get command. Because of this we provide an alternative probe method # which uses wget. If wget is not installed on your system you must install it # manually and provide the WgetPath variable. If the WgetPath variable is not set, # it defaults to /usr/sfw/bin/wget. # You can use the wget algorithm for https probe as well which are not possible # with the http get command. # # Use the variables TestUrl and WgetPath as a replacement for: # Port, Host, TestCmd # You can specify only one set of variables. # # TestUrl Url where Tomcat serve a web site. This can be done either # by the http or https protocol # Format: http://hostname:port/startpage # Example: http://localhost:8080/ # You might want to include options here like: # "--no-cookies http://localhost:8080/" # The requirement here is that wget -O - ${TestUrl} produces # the output containing the ReturnString. # WgetPath Abolute path to wget, leaving this variable empty defaults to: # /usr/sfw/bin/wget # Startwait Sleeping $Startwait seconds after completion of the # start command # ReturnString This string must be present in the output of the http get command # or in the output of the wget command. EnvScript= User= Basepath= Host= Port=8080 TestCmd="get /index.jsp" TestUrl= WgetPath= ReturnString="CATALINA" Startwait=20
To use the alternative wget probe, assuming wget is available under /usr/sfw/bin/wget, set the following variables:
EnvScript=/global/mnt1/tomtest/env.ksh User=tomtest Basepath=/global/mnt1/tomtest/jakarta-tomcat-4.1.24 Host= Port= TestCmd= TestUrl="http://localhost:8080/" WgetPath= ReturnString="CATALINA" Startwait=20
This example for Apache Tomcat 4.1.24 configures a standalone web server with the default start page index.jsp. The start page contains the string CATALINA.
EnvScript=/tomcat/env.ksh User=tomcat Basepath=/tomcat/jakarta-tomca-4.1.24 Host=localhost Port=8080 TestCmd="get /index.jsp" TestUrl= WgetPath= ReturnString="CATALINA" Startwait=20
Depending on the selected probe method, the Host parameter or the IP alias in the TestUrl parameter depends on the location of the pfile.
If the pfile is stored on the shared storage, you must use localhost.
If the pfile is stored on the local storage, it can be either localhost or the node's host name.
Do not use the SharedAddress here.
![]() | Caution - The parameter files must be available on every node that can host the Apache Tomcat data service. For a scalable or a multiple-masters configuration, store the parameter files on the local file system of every node or on the shared storage. The parameter files must not differ for any instance of Apache Tomcat on the various nodes. |
Repeat this Step for every Apache Tomcat instance and every node you need.
# 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, 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=
The following is an example for Apache Tomcat.
RS=tomcat-res RG=tomcat-rg PORT=8080 LH=tomcat-lh SCALABLE=true NETWORK=true PFILE=/tomcat/pfile HAS_RS=Apache-Tomcat-has-resource
Configure the parameter LH need to be configured as the name of the shared address. 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.
# ksh ./sctomcat_register desired place/sctomcat_config
Repeat Steps 9, 10, an 11 for every Apache Tomcat instance you need.
Repeat this step for each Apache Tomcat resource created in the previous step.
#
# clresource enable Apache-Tomcat-resource