E
dit
A
ttach
P
rintable
r8 - 2015-06-09 - 18:53:47 - Main.sbeard
You are here:
TWiki
>
Deployment Web
>
DeploymentInstallingUpgradingAndMigrating
>
ImplementingApplicationRecoveryExampleScript
<div id="header-title" style="padding: 10px 15px; border-width:1px; border-style:solid; border-color:#FFD28C; background-image: url(<nop>https://jazz.net/wiki/pub/Deployment/WebPreferences/TLASE.jpg); background-size: cover; font-size:120%"> ---+!! Implementing application recovery: Example script for a Jazz deployment on !WebSphere %DKGRAY% Authors: Main.MikeDelargy, Main.JeffBabylon <br> Build basis: Jazz applications in CLM and SSE %ENDCOLOR%</div></sticky> <!-- Page contents top of page on right hand side in box --> <sticky><div style="float:right; border-width:1px; border-style:solid; border-color:#DFDFDF; background-color:#F6F6F6; margin:0 0 15px 15px; padding: 0 15px 0 15px;"> %TOC{title="Page contents"}% </div></sticky> <sticky><div style="margin:15px;"></sticky> Whether your Jazz applications are deployed on !PowerVM using !PowerHA, !VMware ESXi Server using !VMware HA or physical servers, below is an example of a script that can be used in a "cron Job" or "scheduled task" to detect whether Jazz application(s) is/are available or not. In the example given below: 1 The script is run on the application server hosting the Jazz application(s) 1 The script first checks the associated properties file to see which Jazz application(s) is/are running on the server (you would specify this ahead of time) 1 The script then checks whether each of the specified Jazz applications (JTS, RTC, RQM, RRC etc.) are returning a good http response (a 200 response) 1 If any of the specified Jazz applications return anything other than a 200 response, the script then restarts the !WebSphere Application Server. The attached script is platform independent. ---++ Files needed for this example *There are two files needed for our example to work successfully.* 1 *checkCLM.pl* [[%ATTACHURL%/checkCLM.pl.txt][checkCLM.pl.txt]] (remove the .txt extension) 1 *checkCLM.properties* [[%ATTACHURL%/checkCLM.properties][checkCLM.properties]] (The Properties file has been modified to check each of the Jazz applications ... JTS, CCM, RQM, RRC etc.) *checkCLM.pl* is a PERL script that first reads the checkCLM.properties file to obtain information about your deployment. It then invokes curl to check the http response. If the response is anything other than 200, it invokes a server shutdown and then a server start-up. *checkCLM.properties* Is a file that is called by the checkCLM.pl script. The file contains: * The public URI * The application context roots in your deployment (only specify the context roots of the applications running on this particular !WebSphere Profile) * The path to the !WebSphere profile on your system * The WAS service name (typically server1). ---+++ Tools necessary for the script to work In order for the script to work, it is assumed that you have both PERL and curl installed and the directory containing these are in your PATH. So as to avoid having to pass WAS credentials to the shutdown command, it is necessary to store these credentials as outlined in the technote: http://www-01.ibm.com/support/docview.wss?uid=swg21440555 ---+++ Using the script You can create a cron job or scheduled task that starts the *checkCLM.pl* script every five minutes (or whatever meets your needs) The *checkCLM.pl* and the *checkCLM.properties* files must be located in the same directory. The *checkCLM.pl* script will create / append a log file in the same directory called *checkCLM.log*. ---++ checkCLM.properties CUSTOMIZATIONS The attached checkCLM.properties file checks for all four of the CLM applications (JTS, CLM, RTC, and RRC) It has a public URI stem of https://clmserver:9443 The !WebSphere profile hosting the applications is installed in C:\IBM\Websphere\Appserver\profiles\AppSRV01 *The contents of the properties file:* PUBLIC_URI_HOSTNAME=https://clmserver:9443/ %BR% WAS_SERVICE_NAME=server1 %BR% WAS_SERVER_PROFILE_PATH=C:\IBM\Websphere\Appserver\profiles\AppSRV01 %BR% CONTEXT_ROOT_JTS=jts %BR% CONTEXT_ROOT_RQM=qm %BR% CONTEXT_ROOT_RM=rm %BR% CONTEXT_ROOT_CCM=ccm _In the example above, notice the context roots of my applications (jts, qm, rm, and ccm)_ *If I only had JTS running on this server, the properties file would be:* PUBLIC_URI_HOSTNAME=https://clmserver:9443/ %BR% WAS_SERVICE_NAME=server1 %BR% WAS_SERVER_PROFILE_PATH=C:\IBM\Websphere\Appserver\profiles\AppSRV01 %BR% CONTEXT_ROOT_JTS=jts %BR% CONTEXT_ROOT_RQM= %BR% CONTEXT_ROOT_RM= %BR% CONTEXT_ROOT_CCM= _If only one application is running on the given server, then omit only the context root for the other applications, but leave the variable._ *If I only have RQM running on this server, the properties file would have:* PUBLIC_URI_HOSTNAME=https://clmserver:9443/ %BR% WAS_SERVICE_NAME=server1 %BR% WAS_SERVER_PROFILE_PATH=C:\IBM\Websphere\Appserver\profiles\AppSRV01 %BR% CONTEXT_ROOT_JTS= %BR% CONTEXT_ROOT_RQM=qm %BR% CONTEXT_ROOT_RM= %BR% CONTEXT_ROOT_CCM= _It is very important for the checkCLM.pl script provied that we leave the "stems" (CONTEXT_ROOT_JTS=, CONTEXT_ROOT_CCM=, and CONTEXT_ROOT_RM= ) but we leave the context roots for them empty if they are not running on the specified server._ *If I only have JTS and RTC running on this application, my properties file would have:* PUBLIC_URI_HOSTNAME=https://clmserver:9443/ %BR% WAS_SERVICE_NAME=server1 %BR% WAS_SERVER_PROFILE_PATH=C:\IBM\Websphere\Appserver\profiles\AppSRV01 %BR% CONTEXT_ROOT_JTS=jts %BR% CONTEXT_ROOT_RQM= %BR% CONTEXT_ROOT_RM= %BR% CONTEXT_ROOT_CCM=ccm *If I am using context root from an older version of RQM ( a 2.x version) my properties file would have:* PUBLIC_URI_HOSTNAME=https://clmserver:9443/ %BR% WAS_SERVICE_NAME=server1 %BR% WAS_SERVER_PROFILE_PATH=C:\IBM\Websphere\Appserver\profiles\AppSRV01 %BR% CONTEXT_ROOT_JTS= %BR% CONTEXT_ROOT_RQM=jazz %BR% CONTEXT_ROOT_RM= %BR% CONTEXT_ROOT_CCM= *If I were running my applications on Linux, my properties file would be something that parallels this:* PUBLIC_URI_HOSTNAME=https://clmserver:9443/ %BR% WAS_SERVICE_NAME=server1 %BR% WAS_SERVER_PROFILE_PATH=/opt/BM/Websphere/Appserver/profiles/AppSRV01 %BR% CONTEXT_ROOT_JTS=jts %BR% CONTEXT_ROOT_RQM=qm %BR% CONTEXT_ROOT_RM=rm %BR% CONTEXT_ROOT_CCM=ccm ---++ Enterprise Deployment In an enterprise deployment, each application server would run the checkCLM.pl file and the checkCLM.properties file would be specific to the application hosted on that machine. ---++ What can you expect when running the script? The script creates a date stamped log file (a new log file each day). *If each of the applications is running well, your log file would look something like this:* %BR% [2014-03-14.17.26.26] INFO - Starting checkCLM script. %BR% [2014-03-14.17.26.26] INFO - Reading properties file. %BR% [2014-03-14.17.26.26] INFO - [Property:Value] PUBLIC_URI_HOSTNAME: https://clm2:9443/ %BR% [2014-03-14.17.26.26] INFO - [Property:Value] WAS_SERVICE_NAME: server1 %BR% [2014-03-14.17.26.26] INFO - [Property:Value] WAS_SERVER_PROFILE_PATH: C:\IBM\WebSphere\AppServer\profiles\AppSrv01 %BR% [2014-03-14.17.26.26] INFO - [Property:Value] CONTEXT_ROOT_JTS: jts %BR% [2014-03-14.17.26.26] INFO - [Property:Value] CONTEXT_ROOT_RQM: qm %BR% [2014-03-14.17.26.26] INFO - [Property:Value] CONTEXT_ROOT_RM: rm %BR% [2014-03-14.17.26.26] INFO - [Property:Value] CONTEXT_ROOT_CCM: ccm %BR% [2014-03-14.17.26.26] INFO - Closing properties file. %BR% [2014-03-14.17.26.26] INFO - Beginning Server Response Checks: %BR% [2014-03-14.17.26.26] INFO - Checking server response from jts/admin... %BR% [2014-03-14.17.26.26] INFO - [JTS_RESPONSE]: https://clm2:9443/jts/admin: 200 %BR% [2014-03-14.17.26.26] INFO - Checking server response from qm/admin... %BR% [2014-03-14.17.26.27] INFO - [QM_RESPONSE]: https://clm2:9443/qm/admin: 200 %BR% [2014-03-14.17.26.27] INFO - Checking server response from ccm/admin... %BR% [2014-03-14.17.26.29] INFO - [CCM_RESPONSE]: https://clm2:9443/ccm/admin: 200 %BR% [2014-03-14.17.26.29] INFO - Checking server response from rm/web... %BR% [2014-03-14.17.26.30] INFO - [RM_RESPONSE]: https://clm2:9443/rm/web: 200 %BR% [2014-03-14.17.26.30] INFO - ALL server response checks completed with response 200. %BR% [2014-03-14.17.26.30] INFO - Cleaning up and closing log file. %BR% [2014-03-14.17.26.30] INFO - Stopping checkCLM script. *If the script receives a 'bad' response from the http response of an application, you can expect to see something like this:* (In our example, ccm is down) -14.15.36.26] INFO - Beginning Server Response Checks: %BR% [2014-03-14.15.36.26] INFO - Checking server response from jts/admin... %BR% [2014-03-14.15.37.02] INFO - [JTS_RESPONSE]: https://clm2:9443/jts/admin: 200 %BR% [2014-03-14.15.37.02] INFO - Checking server response from qm/admin... %BR% [2014-03-14.15.37.59] INFO - [QM_RESPONSE]: https://clm2:9443/qm/admin: 200 %BR% [2014-03-14.15.37.59] INFO - Checking server response from ccm/admin... %BR% *[2014-03-14.15.38.00] ERROR - [CCM_RESPONSE]: https://clm2:9443/ccm/admin: 404* _(The actual log file will not have this in bold)_ %BR% [2014-03-14.15.38.00] INFO - Checking server response from rm/web... %BR% [2014-03-14.15.38.12] INFO - [RM_RESPONSE]: https://clm2:9443/rm/web: 200 %BR% [2014-03-14.15.38.12] INFO - PID File Found. Executing C:\IBM\WebSphere\AppServer\profiles\AppSrv01\bin\stopServer.bat server1. %BR% [2014-03-14.15.39.02] INFO - [STOP SERVER RESPONSE]: %BR% ADMU0116I: Tool information is being logged in file %BR% C:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\server1\stopServer.log %BR% ADMU7702I: Because server1 is registered to run as a Windows Service, the %BR% request to stop this server will be completed by stopping the %BR% associated Windows Service. %BR% ADMU0116I: Tool information is being logged in file %BR% C:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\server1\stopServer.log %BR% ADMU0128I: Starting tool with the AppSrv01 profile %BR% ADMU3100I: Reading configuration for server: server1 %BR% ADMU3201I: Server stop request issued. Waiting for stop status. %BR% ADMU4000I: Server server1 stop completed. %BR% [2014-03-14.15.39.02] INFO - WAS successfully stopped. Attempting restart... %BR% [2014-03-14.15.39.02] INFO - Executing C:\IBM\WebSphere\AppServer\profiles\AppSrv01\bin\startServer.bat server1 [2014-03-14.15.40.52] INFO - [START SERVER RESPONSE]: %BR% ADMU0116I: Tool information is being logged in file %BR% C:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\server1\startServer.log %BR% ADMU7701I: Because server1 is registered to run as a Windows Service, the %BR% request to start this server will be completed by starting the %BR% associated Windows Service. %BR% ADMU0116I: Tool information is being logged in file C:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\server1\startServer.log %BR% ADMU0128I: Starting tool with the AppSrv01 profile %BR% ADMU3100I: Reading configuration for server: server1 %BR% ADMU3200I: Server launched. Waiting for initialization status. %BR% ADMU3000I: Server server1 open for e-business; process id is 1856 *In the example below, I only have JTS, RRC, and RQM running on the system (no RTC / CCM)* -14.17.01.26] INFO - Beginning Server Response Checks: %BR% [2014-03-14.17.01.26] INFO - Checking server response from jts/admin... %BR% [2014-03-14.17.01.26] INFO - [JTS_RESPONSE]: https://clm2:9443/jts/admin: 200 %BR% [2014-03-14.17.01.26] INFO - Checking server response from qm/admin... %BR% [2014-03-14.17.01.27] INFO - [QM_RESPONSE]: https://clm2:9443/qm/admin: 200 %BR% [2014-03-14.17.01.27] INFO - [CCM_SKIPPED]: CCM Not checked as no context root is specified in the properties file %BR% [2014-03-14.17.01.27] INFO - Checking server response from rm/web... %BR% [2014-03-14.17.01.28] INFO - [RM_RESPONSE]: https://clm2:9443/rm/web: 200 %BR% [2014-03-14.17.01.28] INFO - ALL server response checks completed with response 200. %BR% [2014-03-14.17.01.28] INFO - Cleaning up and closing log file. %BR% [2014-03-14.17.01.28] INFO - Stopping checkCLM script. %BR% [2014-03-14.17.06.26] INFO - Starting checkCLM script. %BR% [2014-03-14.17.06.26] INFO - Reading properties file. %BR% [2014-03-14.17.06.26] INFO - [Property:Value] PUBLIC_URI_HOSTNAME: https://clm2:9443/ %BR% [2014-03-14.17.06.26] INFO - [Property:Value] WAS_SERVICE_NAME: server1 %BR% [2014-03-14.17.06.26] INFO - [Property:Value] WAS_SERVER_PROFILE_PATH: C:\IBM\WebSphere\AppServer\profiles\AppSrv01 %BR% [2014-03-14.17.06.26] INFO - [Property:Value] CONTEXT_ROOT_JTS: jts %BR% [2014-03-14.17.06.26] INFO - [Property:Value] CONTEXT_ROOT_RQM: qm %BR% [2014-03-14.17.06.26] INFO - [Property:Value] CONTEXT_ROOT_RM: rm %BR% [2014-03-14.17.06.26] INFO - [Property:Value] CONTEXT_ROOT_CCM: NA %BR% [2014-03-14.17.06.26] INFO - Closing properties file. %BR% [2014-03-14.17.06.26] INFO - Beginning Server Response Checks: %BR% [2014-03-14.17.06.26] INFO - Checking server response from jts/admin... %BR% [2014-03-14.17.06.26] INFO - [JTS_RESPONSE]: https://clm2:9443/jts/admin: 200 %BR% [2014-03-14.17.06.26] INFO - Checking server response from qm/admin... %BR% [2014-03-14.17.06.27] INFO - [QM_RESPONSE]: https://clm2:9443/qm/admin: 200 %BR% [2014-03-14.17.06.27] INFO - [CCM_SKIPPED]: CCM Not checked as no context root is specified in the properties file %BR% [2014-03-14.17.06.27] INFO - Checking server response from rm/web... %BR% [2014-03-14.17.06.28] INFO - [RM_RESPONSE]: https://clm2:9443/rm/web: 200 %BR% [2014-03-14.17.06.28] INFO - ALL server response checks completed with response 200. %BR% [2014-03-14.17.06.28] INFO - Cleaning up and closing log file. %BR% [2014-03-14.17.06.28] INFO - Stopping checkCLM script. _notice the log file states that CCM was not checked. That is because our properties file did not have a value of the CCM context root._ ---+++++!! Related topics: [[ApproachesToImplementingHAAndDR][Approaches to implementing high availability and disaster recovery for Rational Jazz environments]] ---+++++!! External links: * None ---+++++!! Additional contributors: None <sticky></div></sticky>
E
dit
|
A
ttach
|
P
rintable
|
V
iew topic
|
Backlinks:
We
b
,
A
l
l Webs
|
H
istory
: r8
<
r7
<
r6
<
r5
<
r4
|
M
ore topic actions
Deployment.ImplementingApplicationRecoveryExampleScript moved from Deployment.ImplementingApplicationHARecoveryExampleScript on 2014-03-29 - 16:58 by Main.sbeard
-
Deployment
Deployment web
Planning and design
Installing and upgrading
Migrating and evolving
Integrating
Administering
Monitoring
Troubleshooting
Community information and contribution guidelines
Create new topic
Topic list
Search
Advanced search
Notify
RSS
Atom
Changes
Statistics
Web preferences
NOTE: Please use the Sandbox web for testing
Status icon key:
To do
Under construction
New
Updated
Constant change
None - stable page
Smaller versions of status icons for inline text:
Copyright © by IBM and non-IBM contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our
Terms of Use.
Please read the following
disclaimer
.
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more
here
.