Go to main content

Oracle® Solaris Cluster Data Service for Apache Tomcat Guide

Exit Print View

Updated: August 2018
 
 

Understanding the HA for Apache Tomcat Parameter File

Use this information to understand the contents of the HA for Apache Tomcat parameter file. This section describes the structure and the content of the HA for Apache Tomcat parameter file, as well as the strategy to choose some of its variables.

Structure of the HA for Apache Tomcat Parameter File

HA for Apache Tomcat uses a parameter file to pass parameters to the start, stop, and probe command. This parameter file needs to be a valid Korn shell script which sets several variables. The structure of this file appears in Table 6, Structure of the HA for Apache Tomcat Parameter File. For examples of the parameter file refer to Registering and Configuring HA for Apache Tomcat.

Table 6  Structure of the HA for Apache Tomcat Parameter File
Variable
Explanation
EnvScript
This is a ksh script or a csh script, depending on the login-shell of the user name that owns Apache Tomcat. The purpose of this script is to set the Apache Tomcat specific environment variables, which are needed to start and stop the Apache Tomcat instance.
User
The owner of the Apache Tomcat instance.
Basepath
The absolute pathname to the directory where the Apache Tomcat /bin directory resides. Typically, it is CATALINA_HOME.
Host
The host to test the functionality of the Apache Tomcat server process. The Test is done via a connection to Host:Port.
Port
A port where Apache Tomcat is serving. This Port is used together with the Host to test the functionality of the Apache Tomcat server process.
TestCmd
This variable represents the command that is passed to the Apache Tomcat server process to test its sanity.
ReturnString
The variable ReturnString represents the string that must be present in the answer to the TestCmd. It cannot be Connection refused because this string is in the answer when the Apache Tomcat server process is not running.
Startwait
This variable represents the number of seconds to wait after the Apache Tomcat start command is completed. It lasts until the Apache Tomcat server process is fully operational. The absolute number of seconds depends on the speed and the load of the hardware. A good strategy is to start with 10 to 20 seconds.
TestUrl
This variable presents a complete http or https URL, which is passed to the wget command to test the Tomcat server's sanity.
WgetPath
This variable presents the absolute path to the wget binary, if the wget binary is not located under /usr/sfw/bin/wget.

The parameters in Table 6, Structure of the HA for Apache Tomcat Parameter File can be changed at any time. The only difference is when changes take effect.

The following parameters of the HA for Apache Tomcat parameter file are used for starting and stopping Apache Tomcat. Changes to these parameters take effect at every restart or disabling and enabling of an HA for Apache Tomcat resource.

  • EnvScript

  • User

  • Basepath

  • Startwait

  • TestUrl

  • WgetPath

The following parameters of the HA for Apache Tomcat parameter file are used within the fault monitor. Changes to these parameters take effect at every Thorough_probe_interval.

  • Host

  • Port

  • TestCmd

  • ReturnString

Strategy to Choose the TestCmd and the ReturnString Variable

The following alternatives are available to choose the ReturnString variable:

  • Take the start page of your application and set the TestCmd to get /start_page. If you picked the wget probe method, set TestUrl to http://ipalias:port/start_page. With this strategy, you are monitoring that Apache Tomcat is serving your application.

  • Take the Apache Tomcat default start page and set the TestCmd to get /default-start-page. If you picked the wget method, set TestUrl to http://ipalias:port/default-start-page. In this case, set the ReturnString to a string contained in the start page. Typically this string is CATALINA. With this strategy, you are monitoring that Apache Tomcat is serving its default application.

  • Deploy a test application (which is not provided with the HA for Apache Tomcat agent) to Apache Tomcat. Set the TestCmd to get start-page_of_the_application. If you use the wget method, set TestUrl to http://ipalias:port/start-page_of_the_application. In this case, set the ReturnString to a string contained in the start page. With this strategy, you are monitoring that Apache Tomcat is serving your test application.

  • If none of the above is appropriate, set the TestCmd to get /a-page-that-does-not-exist. In this case, set the ReturnString to a string contained in the Error Page. With this strategy, you are monitoring that Apache Tomcat is operational, because it registers that it must deliver a page that does not exist.

You can evaluate the different pages by connecting using a browser with hostname:port and specifying the different pages.