Monday, October 24, 2011

Creating custom jvm scripts for starting through node manager

The primary aim of nodemanager is to restart managed servers when the go down and also you can start or stop managed servers from the console.
Now StartScriptEnabled=true will use the managed server script. If your start script is named startWebLogic.sh or startWebLogic.cmd, Node Manager uses one of those scripts as the default. So now when you start a managed server from console, it will use its own startWebLogic.sh or startWebLogic.cmd to come up via nodemanager since StartScriptEnabled=true.
If you would like to Set different environment properties to each jvm then doing it in the console is one of the best methods, however you can also modify the startweblogic.sh script to the example as below

if ["${SERVER_NAME}"==ms1]
then
JAVA_OPTIONS="-Xverboselog:/osb/oracle/bea/user_projects/domains/osb_domain/servers/OSBJMS2/logs/ms1gc1.log -Xverbose:memory ${JAVA_OPTIONS}"
echo %JAVA_OPTIONS%
exit
fi

if ["${SERVER_NAME}"==ms2]
then
JAVA_OPTIONS="-Xverboselog:/osb/oracle/bea/user_projects/domains/osb_domain/servers/OSBJMS2/logs/ms2gc2.log -Xverbose:memory ${JAVA_OPTIONS}"
echo %JAVA_OPTIONS%
exit
fi

No comments: