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.

server_start.PNG
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:
cd('Servers/YOUR_SERVER_NAME/ServerStart/YOUR_SERVER_NAME')
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.

Comments:

"Arguments" is an read-only attribute, how can this be set ? WLST is throwing "Attribute is readonly" exception.

Posted by guest on October 08, 2009 at 08:15 AM PDT #

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: edit() startEdit() setAttribute('Arguments', 'foo') validate() *optional* save() activate() There is more detailed information here: http://download.oracle.com/docs/cd/E12839_01/web.1111/e13715/config_wls.htm#WLSTG191.

Posted by josh.dorr on October 08, 2009 at 08:42 AM PDT #

Nicely said. Can't agree with you more. I wished others would feel this way.

Posted by Lakeesha Kimbril on December 22, 2010 at 12:10 AM PST #

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.

Posted by drug treatment on April 09, 2011 at 05:02 AM PDT #

This site is my aspiration , real superb pattern and perfect subject matter.

Posted by Andrew A. Sailer on April 21, 2011 at 03:55 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The official blog for Oracle WebLogic Server fans and followers!

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today