Thursday, October 31, 2013

How to start and stop WebLogic nodemanager through WLST

Since WebLogic 12 the use of the WLST function startNodeManager() is deprecated. Infact if you run within the FMW installation of WebLogic, trying to start nodemanager from within WLST will result in the error:
weblogic.nodemanager.common.ConfigException: Identity key store file not found: kss://system/demoidentity
The reason is that you need to run setDomainEnv.sh before starting nodemanager, because nodemanager tries to contact the security store, which resides in the Oracle MDS database in this case.

The recommended way to start nodemanager is through OS initialization scripts.

Still - if one wants to start nodemanager through WLST, it could be accomplished as follows:
import os                #Load module interface to Operating System
MW_HOME = os.environ.get("MW_HOME")  #Get required environment variables
NODEMGR_HOME = os.environ.get("NODEMGR_HOME")
# Start nodemanager through OS System call
os.system(MW_HOME + '/wlserver/server/bin/startNodeManager.sh > ' + NODEMGR_HOME + '/nodemanager.out 2>&1 &')
But before invoking wlst.sh, to run the above, make sure that you did run $DOMAIN_HOME/setDomainEnv.sh!!

To stop nodemanager through WLST, there is a stopNodeManager() function available. But for this to work, it is required to set the flag
QuitEnabled=true 
in nodemanager.properties file.

No comments: