Proactive insights, news and tips from Oracle WebLogic Server Support. Learn Oracle from Oracle.

  • August 20, 2009

Starting WLS through nodemanager details

More and more users are utilizing the nodemanager agent to start and monitor their WebLogic server instances. This helps ensure high availability of the WebLogic Server with automatic restarts as well as supporting automatic whole server migration. With this increased use there has also been an increase in scenarios for starting a WebLogic Server instance. In fact some questions have come up on how to configure the domain for setting specific properties or environment variables for a WebLogic Server instance when it is started through the nodemanager agent.

The best method for specifying command line properties for a server is by specifying those properties in the ServerStartMBean's arguments attribute. Each ServerMBean has a ServerStartMBean that stores start up specific values. These values can be set in the console by visiting the server specific configuration page, and then finding the "ServerStart" tab where the attributes can be set. These values can also be set in an edit session using WLST:


set('Arguments', '-Dweblogic.debug.DebugServerMigration')

Setting the values in the ServerStartMBean will ensure that "-Dweblogic.debug" flags or other custom properties are passed to the server. This is because a start call from the console or from WLST will go through the admin server, gathering the appropriate properties from the configuration, and send this information to the nodemanager. The information will be passed to the server regardless of whether the nodemanager is configured to start the server using a java command line (default) or a start script.

Storing the information in the ServerStartMBean also ensures that the information is centrally stored in the config.xml and will be referenced no matter which machine and nodemanager is used when starting the WebLogic Server. This will help to set the value once and maintain it in the configuration as opposed to storing it in start scripts scattered across multiple machines.

Another requirement may be an environment variable be specified prior to starting the server. There are 2 different ways to do this.

1. Make use of a custom start script that will contain the specific environment variables necessary. To do this, first configure the nodemanager to use a custom start script by specifying StartScriptEnabled=true and StartScriptName=customStartWebLogic.sh in the nodemanager.properties file or on the command line when starting the nodemanager. Then create the customStartWebLogic.sh in the domain directory that will set the appropriate variables and subsequently call startWebLogic.sh. An very basic example of customStartWebLogic.sh below:

export FOO=foo_value

. ./startWebLogic.sh

2. Make use of the environment that the java based nodemanager is running in to pass that information on to the server. To do this, set the necessary environment variables prior to starting the nodemanager.

Both of these solutions allow for multiple servers to be started through the nodemanager without having to set the same property for each server. But they also create an extra configuration step for each machine that will be used in the domain. The advantages of creating a custom start script is that the configuration will preserve the correct environment variable, where the nodemanager environment may leave room for a mistake where the environment variable is not correctly set.

Join the discussion

Comments ( 5 )
  • guest Thursday, October 8, 2009
    "Arguments" is an read-only attribute, how can this be set ? WLST is throwing "Attribute is readonly" exception.
  • josh.dorr Thursday, October 8, 2009
    When using WLST to edit the configuration of a domain, you must first obtain the edit lock and then make your changes. After you have made your changes you must save and activate the changes in the domain.
    The typical edit session will look like the following:
    setAttribute('Arguments', 'foo')
    validate() *optional*
    There is more detailed information here: http://download.oracle.com/docs/cd/E12839_01/web.1111/e13715/config_wls.htm#WLSTG191.
  • Lakeesha Kimbril Wednesday, December 22, 2010
    Nicely said. Can't agree with you more. I wished others would feel this way.
  • drug treatment Saturday, April 9, 2011
    Hello, have been browsing for a couple of days now and just wanted to write you a short note to say what a terrific learning resource I think you have going here, keep up the great work.
  • Andrew A. Sailer Thursday, April 21, 2011
    This site is my aspiration , real superb pattern and perfect subject matter.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.