Before You Begin
This procedure assumes that you installed the data service packages.
If you did not install the HA for Apache Tomcat packages, go to Installing the HA for Apache Tomcat Package.
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-location
Repeat this step for every Apache Tomcat instance you need.
For example:
#!/usr/bin/ksh # # Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. # #ident "@(#)pfile.ksh 1.6 01/12/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. 5.x or 6.x CATALINA_HOME # 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
![]() | 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 on the shared storage. The parameter files cannot differ for any instance of Apache Tomcat on the various nodes. |
# cd /opt/SUNWsctomcat/util # cp sctomcat_config desired-location
Repeat this step for each Apache Tomcat instance you need.
For example:
# # Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. # #ident "@(#)sctomcat_config.ksh 1.2 01/03/12" # 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-location/sctomcat_config
Repeat this step for each Apache Tomcat instance you need.
# clresource status # clresource enable Apache-Tomcat-resource