Search This Blog

Oracle Fusion Middleware Administration Course

Oracle Fusion Middleware Administration Course
OFMW Admin Course

Saturday, December 18, 2010

Bounce Servers with NodeManager using WLST

NodeManager using WLST
Any Middleware admin can make their life easy with WLST, to play with Server Life Cycle we can use NodeManager WLST commands. WLST provides us

  • start the NodeManager
  • connect to the NodeManager, then we can use them to start or stop the WebLogic servers on the machine.

Start Node Manager

Usually, as part of configuring Node Manager, you create a Windows service or a daemon that automatically starts Node Manager when the host computer starts.

If Node Manager is not already running, you can logon to the host computer and use WLST to start it as shown:
c:\>java weblogic.WLST 
wls:/offline> startNodeManager()
We can connect from the WLST SHELL to a NodeManager by entering the nmConnect command. 
For example, 
nmConnect('weblogic', 'secret', 'localhost', '5556', 'mydomain','c:/bea/user_projects/domains/mydomain','ssl')
Connecting to Node Manager ... 
Successfully connected.

BEA-090403 :Authentication for user denied

If you are not configured the NodeManager running WebLogic domain then, You never know what is the nodemanager user, password for that domain. By default the WebLogic admin Console must works. One of my experiance that there could be multiple users access the WebLogic admin role in such situations we need to check the initial domain configuration made up with the user credential that will help you to start the Node Manager. If it doesn't works for you then update the Node Manager username and password in the WebLogic Console and then connect.
nmDisconnect() command will do, disconnect WLST from a Node Manager session.
nm() command - You may execute many WLST commands in between nmStart and nmDisconnect then, you wonder that is it connected to NodeManager or not. To check this at WLST Shell prompt we have nm command

wls:/offline> nm()
Not connected to Node Manager

nmStart - Starts a server in the current domain using Node Manager, Conditionas applyed !! Java Node Managed will work here the Node Manager running on the different machine cannot execute this command.
Let use the nmStart command to start the Admin server as it is known as a best practice. 
starting server AdminServer ... 
Server AdminServer started successfully

nmKill command - will kills the specified WebLogic server instance that was started with the Node Manager only. 
Killing server AdminServer
Server AdminServer killed successfully

Best Practices with Nodemanager

  • Use the nodemanager to start the admin server
  • connect to the admin server
  • start the managed servers with regular WLST lifecycle commands
  • Don't kill the managed server with UNIX kill command when it is started with a Node Manager or with WLST nmStart command

WLST Life cycle commands will enables you to start all managed servers in the domain with single connection to the admin server, regardless of which machines host these Managed Servers.

My online buddy asked me to publish a WLST script for Node maneger that bounces WebLogic server. Its really wonderful thought having this idea with WLST.

Have it your way
This script you can customized as per your environment.
Here you need to do the following which are instructed by buddy because I don't have NodeManager environment test this script. But strongly confident that this will work for you,
* please change the AdminServer's Listen address, Listen port in connection module.

# This module will starts the NodeManager
# Author: Sumanth Krishna
def startnm():
  print dumpStack()
# The module NodeManager connects to the AdminServer
def connectnm():
     print dumpStack()

# This module is for starting the AdminServer pass AdminServer name
def startAdminServer(svrName):
      print "Problem starting the Admin server "+svrName

# This module for starting the managed server
def startManagedServers():
     mbeans = home.getMBeansByType("ServerLifeCycleRuntime")
     for i in mbeans:
        svrName = i.getName()
        if svrName != serverName:
          if i.getState() != "RUNNING":
     print "Problem starting the managed server "+svrName

#Main functaion i.e., all functions used to call from here
if __name__== "main":
   print 'DONE'

Review this script and write back comments and suggestions to me your trial outputs and issues... whatever you have with this

Good Reference Links:
1. James Bayer blog

Related Posts


  1. Hi

    I am trying to use the script. I am getting a Syntax Error at mbeans = home.getMBeansByType("ServerLifeCycleRuntime") . Is there any configuration that I need to do to be able to use this.



  2. Leon,

    Sorry for inconvence, To reach ServerLifeCycleRuntime you must be connected,you must be on domainRuntime MBean tree.

    Ref :

  3. Bluehost is definitely one of the best hosting company with plans for any hosting needs.

  4. Wow! Great article! It inspired me to make my own blog
    Web Hosting in Malaysia


Please write your comment here

Popular Posts

Oracle WebLogic Administration Course

Oracle WebLogic Administration Course
WebLogic Training