Theoretical problem when WebLogic’s NodeManager is using a start script

Many people will use the WebLogic’s NodeManager to use the start script for starting Managed Servers:

StartScriptEnabled=true

The NodeManager will start the Managed Server using the script and monitor the Managed Server when it fails.

One of the mistakes people can make is creating their own start script and start the Managed Server using ‘nohup &’ within this script: Metalink [ID 984122.1] and [ID 861098.1]. The script will finish and the server keeps running, but the NodeManager thinks the Managed Server has failed…

It will restart the Managed Server (if configured), but fails starting it because the Managed Server was already started:

<ms1> <Server failed during startup so will not be restarted>

This is bad, because the server will not be restarted when the NodeManager sees it failing, marking the Managed Server ‘FAILED_NOT_RESTARTABLE’.

Theoretical

The default startWebLogic.sh script will not finish when used, because it does not use ‘nohup &’. The NodeManager sees everything is fine:

root     17874 16428  0 12:39 ?        00:00:00 /bin/sh /mw_home/user_projects/domains/test_domain/bin/startWebLogic.sh
root     17920 17874 12 12:39 ?        00:00:38 /mw_home/jrockit_160_17_R28.0.0-679/bin/java -jrockit -Xms512m -Xmx512m -Dwebl...

Killing the Managed Server (kill -9 17920) will make the NodeManager restart the Manager Server: OK!

Killing the startWebLogic.sh script (kill -9 17874) however, will also make the NodeManager restart the Manager Server. The Managed Server is not down, so a restart will fail:

<ms1> <Server failed during startup so will not be restarted>

Same situation as described above: This means the NodeManager will not restart the Managed Server if it really fails, marking the Managed Server ‘FAILED_NOT_RESTARTABLE’: not OK.

Conclusion?

A Managed Server could fail, those things happen… but a shell script failing?!

Tagged , , , . Bookmark the permalink.

3 Responses to Theoretical problem when WebLogic’s NodeManager is using a start script

  1. Chandra says:

    Hi,

    I tried killing the process for startWeblogic.sh script which was spawned by NM, but the server didn’t go to FAILED_NOT_RESTARTABLE state, but the NM does try to restart the managed server and it can’t create the JVM as the manage server is already running.

  2. Satish says:

    Here is my custom startupscript (startMSWebLogic.sh)

    APP_CONFIG_CLASSPATH=”${WL_HOME}/applications/isd_classes/”
    export APP_CONFIG_CLASSPATH
    ./startWebLogic.sh

    After a while my managed server state is running, but column ‘Status of Last Action’ as failed.
    And when I shutdown the Managed server from console, its state is changing to “FAILED_NOT_RESTARTABLE”

    Please help me how to resolve this issue.

    • Ian Hoogeboom says:

      Satish,

      The problem probably lies in starting the Managed Server directly with a script and not with the Node Manager. In my blog post, the Node Manager sees the script as stopped because of the ‘&’ and therefore thinks it has shutdown.
      If stopped or started with the console, it runs via the Node Manager, but since you did not start it with the Node Manager, the ‘console’ is unaware of the state of the Managed Server (it’s last state maybe ‘failed’).
      Have a look at the ‘WebLogic Scripting Tool’ (wlst), the sequence of starting the Node Manager, Admin Server and Managed Server is a bit like this:

      wlst.sh
      > startNodeManager()
      > nmConnect()
      > nmStart(‘AdminServer’)
      > connect(‘user’,’pass’)
      > start()

      For a pretty advanced start/stop script how-to, check this blog post:
      http://middlewaremagic.com/weblogic/?p=8187

      Hope this helps…
      Ian.

Leave a Reply

Your email address will not be published. Required fields are marked *