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), which also contains the recommended initial AIX Java tuning settings.
We placed this file in a common directory...
/exports/systemfiles/startup...enabling 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/ksh HOSTNAME=$(hostname) # ulimit -d unlimited ulimit -s unlimited ulimit -m unlimited ulimit -n unlimited export AIXTHREAD_SCOPE=S export AIXTHREAD_MUTEX_DEBUG=OFF export AIXTHERAD_COND_DEBUG=OFF export AIXTHREAD_RWLOCK_DEBUG=OFF export SPINLOOPTIME=500 # APPSRVS="server1" # case "${HOSTNAME}" in "uk.itsc.austin.ibm.com") APPSRVN="TradeAppSrv" /usr/IBM/WebSphere/AppServer/bin/startManager.sh -replacelog ;; "br.itsc.austin.ibm.com") APPSRVN="AppSrv" /usr/IBM/WebSphere/AppServer/bin/startManager.sh -replacelog /usr/IBM/WebSphere/AppServer/profiles/${APPSRVN}/bin/startNode.sh -replacelog /usr/IBM/WebSphere/AppServer/profiles/${APPSRVN}/bin/startServer.sh ${APPSRVS} -replacelog ;; "pt.itsc.austin.ibm.com") APPSRVN="TradeAppSrv" /usr/IBM/WebSphere/AppServer/bin/startManager.sh -replacelog /usr/IBM/WebSphere/AppServer/profiles/${APPSRVN}/bin/startNode.sh -replacelog /usr/IBM/WebSphere/AppServer/profiles/${APPSRVN}/bin/startServer.sh ${APPSRVS} -replacelog ;; "pl.itsc.austin.ibm.com") APPSRVN="TradeAppSrv" /usr/IBM/WebSphere/AppServer/profiles/${APPSRVN}/bin/startNode.sh -replacelog /usr/IBM/WebSphere/AppServer/profiles/${APPSRVN}/bin/startServer.sh ${APPSRVS} -replacelog esac
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 file pt.itsc.austin.ibm.com: /usr/IBM/WebSphere/AppServer/profiles/Dmgr/logs/dmgr/stopServer.log pt.itsc.austin.ibm.com: ADMU0128I: Starting tool with the Dmgr profile pt.itsc.austin.ibm.com: ADMU3100I: Reading configuration for server: dmgr pt.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 file pt.itsc.austin.ibm.com: /usr/IBM/WebSphere/AppServer/profiles/TradeAppSrv/logs/nodeagent/stopServer.log pt.itsc.austin.ibm.com: ADMU0128I: Starting tool with the TradeAppSrv profile pt.itsc.austin.ibm.com: ADMU3100I: Reading configuration for server: nodeagent pt.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 file pt.itsc.austin.ibm.com: /usr/IBM/WebSphere/AppServer/profiles/TradeAppSrv/logs/server1/stopServer.log pt.itsc.austin.ibm.com: ADMU0128I: Starting tool with the TradeAppSrv profile pt.itsc.austin.ibm.com: ADMU3100I: Reading configuration for server: server1 pt.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"