IBM


11.5.2 HACMP configuration

The concept of what needs to be configured on the cluster software side is described in 9.6.4, Configuring external clustering software for Transaction Manager No Operation policy recovery. Here we describe how this needs to be done for HACMP.

There is however a difference in the HACMP setup compared to the other clustering software setups: Our HACMP is an Active/Passive setup while the other clustering software setups are Active/Active. Because of this different setup, the appserver needs to be started outside of HACMP and only the failover of the Transaction Manager is done using HACMP.

We need to configure new start and stop scripts in HACMP as well as for starting the appservers outside of HACMP. These start and stop scripts call the wasctrl-as and wasctrl-tm scripts described in Scripts to start, stop, and monitor WebSphere resources.

Tip: For AIX V5.1, you might have to install an additional module (perl.libwww-5.41.0.0.exe) for the Perl program to execute the wasctrl-tm script. If you use AIX 5.2 or 5.3, this module is installed by default.

This example assumes that you run the TM for wasmember01 on HHOST1 and want to failover the TM to wasmember02 on HHOST2.

1. First we need a script to start the appserver wasmember01 and its Transaction Manager (which is configured with the No Operation policy) on the local system (HHOST1). This script is called server.start and is shown in Example 11-18. The server.start script calls the wasctrl-as and wasctrl-tm scripts with the value start as the action parameter.

We need to execute this script on a command line to start the appserver and TM outside of HACMP.

Example 11-18 server.start script on HHOST1 - starting the appserver and TM

#!/bin/ksh
/usr/bin/HAScrp/wasctrl-as start /usr/WebSphere/AppServer/profiles/Custom01/ 9080 wasmember01
/usr/bin/HAScrp/wasctrl-tm start /usr/WebSphere/AppServer/profiles/Custom01/ 9080 HHOST1 8879 IBM_hc=wascluster01,type=WAS_TRANSACTIONS wascell01 wasmember01 /usr/bin/HAScrp/ wasna05

The same action needs to be done on HHOST2 to start wasmember02. See Example 11-19 for the server.start script for the second system.

Example 11-19 server.start script on HHOST2 - starting the appserver and TM

#!/bin/ksh
/usr/bin/HAScrp/wasctrl-as start /usr/WebSphere/AppServer/profiles/Custom01/ 9080 wasmember02
/usr/bin/HAScrp/wasctrl-tm start /usr/WebSphere/AppServer/profiles/Custom01/ 9080 HHOST2 8879 IBM_hc=wascluster01,type=WAS_TRANSACTIONS wascell01 wasmember02 /usr/bin/HAScrp/ wasna06

2. The appserver (wasmember01) is monitored in HACMP on HHOST1 using the ha.monitor script shown in Example 11-20.

Example 11-20 ha.monitor script on HHOST1

#!/bin/ksh
/usr/bin/HAScrp/wasctrl-as status  /usr/WebSphere/AppServer/profiles/Custom01/ 9080 wasmember01
RC=$?
exit ${RC}

3. We need to define the HACMP start script (ha.start). This script is shown in Example 11-21 and is executed by HACMP on HHOST2 in case of a failure of wasmember01. This script starts the TM of wasmember01 on the secondary system (which is wasmember02 on HHOST2).

Example 11-21 ha.start script - TM failover to HHOST2

#!/bin/ksh
/usr/bin/HAScrp/wasctrl-tm start /usr/WebSphere/AppServer/profiles/Custom01/ 9080 HHOST2 8879 IBM_hc=wascluster01,type=WAS_TRANSACTIONS wascell01 wasmember01 /usr/bin/HAScrp/ wasna05

4. The HACMP stop script for HHOST1 is shown in Example 11-22. This script is executed on HHOST1 when monitoring detected that wasmember01 is down and thus the failover of the TM to wasmember02 is initiated. The script calls the wasctrl-as and wasctrl-tm scripts with the value stop as the action parameter.

Example 11-22 ha.stop script on HHOST1

#!/bin/ksh
/usr/bin/HAScrp/wasctrl-tm stop /usr/WebSphere/AppServer/profiles/Custom01/ 9080 HHOST1 8879 IBM_hc=wascluster01,type=WAS_TRANSACTIONS wascell01 wasmember01 /usr/bin/HAActivationScripts/ wasna05
/usr/bin/HAScrp/wasctrl-as stop /usr/WebSphere/AppServer/profiles/Custom01/ 9080 wasmember01

If you also want to setup failover of the Transaction Manager for wasmember02, then define another HACMP resource group and configure similar scripts to start the other cluster members' TM.


Redbooks ibm.com/redbooks

Next