Starting WLS through nodemanager details
By josh.dorr on Aug 20, 2009
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:
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.
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:
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.