4.7 WebSphere Server start and stop
To be able to start automatically when the host partition is started, we created a common startup file (rc.was) as shown in Example 4-11. This file also contains o the recommended initial AIX Java tuning settings as described in 4.5, AIX-specific Java environment settings. Including the tuning settings in the startup file ensures that these specific settings are only used within the WebSphere process environment.
We placed this file in a common directory, /exports/systemfiles/startup, for general usage on all our WebSphere installations. Placing them in a common location enabled us to use the dsh command to start and stop the WebSphere server from a centralized control point on the CSM Management Server.
Example 4-11 WebSphere rc.was global file
#/bin/kshHOSTNAME=$(hostname)#ulimit -d unlimitedulimit -s unlimitedulimit -m unlimitedulimit -n unlimitedexport AIXTHREAD_SCOPE=Sexport AIXTHREAD_MUTEX_DEBUG=OFFexport AIXTHERAD_COND_DEBUG=OFFexport AIXTHREAD_RWLOCK_DEBUG=OFFexport SPINLOOPTIME=500#APPSRVS="server1"#case "${HOSTNAME}" in"uk.itsc.austin.ibm.com") APPSRVN="TradeAppSrv"/usr/IBM/WAS/AppServer/bin/startManager.sh -replacelog;;"br.itsc.austin.ibm.com") APPSRVN="AppSrv"/usr/IBM/WAS/AppServer/bin/startManager.sh -replacelog/usr/IBM/WAS/AppServer/profiles/${APPSRVN}/bin/startNode.sh -replacelog/usr/IBM/WAS/AppServer/profiles/${APPSRVN}/bin/startServer.sh ${APPSRVS} -replacelog;;"pt.itsc.austin.ibm.com") APPSRVN="TradeAppSrv"/usr/IBM/WAS/AppServer/bin/startManager.sh -replacelog/usr/IBM/WAS/AppServer/profiles/${APPSRVN}/bin/startNode.sh -replacelog/usr/IBM/WAS/AppServer/profiles/${APPSRVN}/bin/startServer.sh ${APPSRVS} -replacelog;;"pl.itsc.austin.ibm.com") APPSRVN="TradeAppSrv"/usr/IBM/WAS/AppServer/profiles/${APPSRVN}/bin/startNode.sh -replacelog/usr/IBM/WAS/AppServer/profiles/${APPSRVN}/bin/startServer.sh ${APPSRVS} -replacelogesac
By replacing the command startServer or startNode with stopServer or stopNode in the rc.was file, as shown in Example 4-11, we could create a new script file called stop.was.
In Example 4-12, we show sample session output using the dsh command to execute the stop.was script from the CSM Management Server madrid.itsc.austin.ibm.com on partition pt.itsc.austin.ibm.com. In addition, we used the option -s for streaming mode.
Example 4-12 Stopping the WebSphere server on partition pt
[0:@MADRID:]#dsh -s -n pt "/exports/systemfiles/startup/stop.was"pt.itsc.austin.ibm.com: ADMU0116I: Tool information is being logged in filept.itsc.austin.ibm.com: /usr/IBM/WAS/AppServer/profiles/Dmgr/logs/dmgr/stopServer.logpt.itsc.austin.ibm.com: ADMU0128I: Starting tool with the Dmgr profilept.itsc.austin.ibm.com: ADMU3100I: Reading configuration for server: dmgrpt.itsc.austin.ibm.com: ADMU3201I: Server stop request issued. Waiting for stop status.pt.itsc.austin.ibm.com: ADMU4000I: Server dmgr stop completed.pt.itsc.austin.ibm.com: ADMU0116I: Tool information is being logged in filept.itsc.austin.ibm.com: /usr/IBM/WAS/AppServer/profiles/TradeAppSrv/logs/nodeagent/stopServer.logpt.itsc.austin.ibm.com: ADMU0128I: Starting tool with the TradeAppSrv profilept.itsc.austin.ibm.com: ADMU3100I: Reading configuration for server: nodeagentpt.itsc.austin.ibm.com: ADMU3201I: Server stop request issued. Waiting for stop status.pt.itsc.austin.ibm.com: ADMU4000I: Server nodeagent stop completed.pt.itsc.austin.ibm.com: ADMU0116I: Tool information is being logged in filept.itsc.austin.ibm.com: /usr/IBM/WAS/AppServer/profiles/TradeAppSrv/logs/server1/stopServer.logpt.itsc.austin.ibm.com: ADMU0128I: Starting tool with the TradeAppSrv profilept.itsc.austin.ibm.com: ADMU3100I: Reading configuration for server: server1pt.itsc.austin.ibm.com: ADMU3201I: Server stop request issued. Waiting for stop status.pt.itsc.austin.ibm.com: ADMU4000I: Server server1 stop completed.
Although the examples shown were used on only one node, the dsh command is capable of running concurrently on several nodes. So we could have shut down all nodes as well as started all servers in one command sequence, as shown in Example 4-13.
Example 4-13 Concurrent stop of WebSphere server on multiple partitions
#dsh -n pt,uk,pl "/exports/systemfiles/startup/stop.was"uk.itsc.austin.ibm.com: ADMU4000I: Server dmgr stop completed.
pl.itsc.austin.ibm.com: ADMU4000I: Server server1 stop completed.pt.itsc.austin.ibm.com: ADMU4000I: Server server1 stop completed.#dsh -n pt,uk,pl "/exports/systemfiles/startup/rc.was"