Monday, April 25, 2011

Using Unix Scripts to Start and Stop Weblogic Managed Servers with Node Manager

In my startup script, I start the Node Manager, then start the Managed Server using WLST
---------------------------------
cd ${MW_HOME}/wlserver_10.3/server/bin
./startNodeManager.sh &
sleep 60
......
cd ${MW_HOME}/wlserver_10.3/common/bin
./wlst.sh ./startManagedWeblogic.py
......

In my stop script, I stop the Managed Server using WLST, then stop the Node Manager
---------------------------------
cd ${MW_HOME}/wlserver_10.3/common/bin
./wlst.sh ./stopManagedWeblogic.py
sleep 10
......
kill -9 `ps -ef|grep nodemanager|grep -v ps|awk '{print $2}'`


Here is the content of startManagedWeblogic.py
---------------------------------
nmConnect('<username>,'<password>','<domainname>','5556','<projectname>','<projectdirectory>','ssl')
nmStart('<managedServer>')

Here is the content of stopManagedWeblogic.py
---------------------------------
nmConnect ('<username>,'<password>','<domainname>','5556','<projectname>','<projectdirectory>','ssl')
nmKill('<managedServer>')

No comments:

Post a Comment