Starting/Stopping IBM WebSphere Application Server (WAS) 7 from the Command Line

Posted by Christopher Parker on Server Fault See other posts from Server Fault or by Christopher Parker
Published on 2010-06-17T18:45:24Z Indexed on 2010/06/17 18:54 UTC
Read the original article Hit count: 414

I've written a script to automate the process of starting, stopping, and restarting WAS7 from the command line. Nothing starts automatically on one of our staging servers, so I have to start everything: deployment manager, node agent, app server, and Web server. The script I wrote seems to work pretty well.

A coworker of mine recommended that I structure my commands differently. I'm wondering if there's a good, valid reason for doing so.

First, my variables:

WAS_HOME="/opt/IBM/WebSphere/AppServer"
WAS_PROFILE_NAME="AppSrv01"
WAS_APP_SERVER="server1"
WAS_WEB_SERVER="webserver1"

How I had the start commands:

"${WAS_HOME}/bin/startManager.sh"
"${WAS_HOME}/bin/startNode.sh" -profileName $WAS_PROFILE_NAME
"${WAS_HOME}/bin/startServer.sh" -profileName $WAS_PROFILE_NAME $WAS_APP_SERVER
"${WAS_HOME}/bin/startServer.sh" -profileName $WAS_PROFILE_NAME $WAS_WEB_SERVER

I was told that I should do it like this, instead:

WAS_DMGR="Dmgr01" # Added variable

"${WAS_HOME}/profiles/${WAS_PROFILE_NAME}/bin/startNode.sh"
"${WAS_HOME}/profiles/${WAS_DMGR}/bin/startManager.sh"
"${WAS_HOME}/profiles/${WAS_PROFILE_NAME}/bin/startServer.sh" $WAS_APP_SERVER
"${WAS_HOME}/profiles/${WAS_PROFILE_NAME}/bin/startServer.sh" $WAS_WEB_SERVER

How is the second way of starting up everything for WebSphere any better or more correct than the first, original, way?

© Server Fault or respective owner

Related posts about command-line

Related posts about sysadmin