Tech

20120810

Node Manager Starting Weblogic Server life cycle explained


Node Manager, is an java instance that ensure high availability of WLS servers with whole server migration and  automatic restarting WLS nodes in case of unwanted shutdown. NM uses the ServerMBean, ServerStartMBean, and SSLMBean to set the JAVA_VENDOR, JAVA_HOME, JAVA_OPTIONS, SECURITY_POLICY, CLASSPATH, and ADMIN_URL. Therefore by using the NM to start a managed server does not necessary uses the domain's bin directory startWebLogic.sh or startWebLogic.cmd to start a node.

This is due because the flag StartScriptEnabled nodemanager.properties file is set to false by default; So this means that all the settings modification done, such as adding debug flags or adding a new jar on the classpath, on startWeblogic.sh will not be pick up or better saying will not be provided to the JVM.

So solve this unpleasant situation you can just go to wlserver_10.3/common/nodemanager directory and edit the nodemanager.properties as following:

StartScriptEnabled=true

Also, you need to pay attention on another configuration on the same file; The StartScriptName actually tells the NM which script should be use to start the WLS node. By default it uses the startWebLogic.sh, but you can create a new file in the domain's bin directory with all needed start-up configurations;

StartScriptName=startWebLogicModified.sh

Understand the some situations you are using the NM to start the WLS nodes without knowing; Sometimes this process seems to be unseeing by administrators. Bellow is the list of situations in which you may be using NM to start servers:

Admin Console - You need to have the NM running to start any instance.

WLST -
1. When you use the following WLST's commands:
start NM:
offline> startNodeManager()
Connect: offline>nmConnect('username','password','nmHost','nmPort','domainName','domainDir','nmType') 
Start Serverwls:/nm/mydomain>nmStart('AdminServer')
Stop Server:
wls:/nm/mydomain>nmKill('serverName')


2. When you use the WLST to connect to the AdminServer, therefore is just like when you use the Admin Console:
Connecting with AdminServer:
(offline)> connect('username','password')
Then you can start by using single server name or cluster:
wls:/mydomain/serverConfig>start('managedServerName','Server')
wls:/mydomain/serverConfig>start('clusterName', 'Cluster')

Pay attention that some basic rules must be follow, for NM to start a server:

1. Any particular server mus be assign to the NM; Do not go around setting partially the cluster to start with NM and hope that all the servers will start. 

2. Is one NM per physical machine; WLS has the great feature of extend a domain across physicals machines, so I insist again remember to assign the WLS nodes to the particular NM located on the same physical machine. 

3. Remember that NM by default uses the ServerStartMBean to set the environment, so if you have edited the startWebLogic.sh the JVM will not pick up the changes. Unless, as explained, you modify these
StartScriptEnabled and StartScriptName accordingly with your requirements on the nodemanager.properties file.

No comments:

Post a Comment