Remote Start

As we have seen, WebLogic can be started on a local machine in a variety of ways. However, in a multiserver environment it would quickly become cumbersome if you were forced to start and stop each server individually. WebLogic is designed to be administered from a central locationthe Administration server. On a running cluster, the Administration server does its work by communicating with Managed server processes on the remote machines.

But what about situations where the Administration server is running, but the Managed servers are not? There are two problems to overcome . First, for obvious reasons, network operating systems have some very deep-seated reservations about starting and stopping programs based solely on instructions from outsiders. The solution to this is to have some program on the Managed server monitoring a port for a startup instruction from the Administration server. The second problem is that you don't necessarily want to keep a full server instance running at all times.

Node Manager

Owing to those and other design considerations, BEA provides a program called Node Manager with all its WebLogic distributions. Node Manager is not another name for WebLogic server. It is an entirely separate program whose job is to monitor a network port for instructions from the Administration server and start and stop WebLogic based on those instructions. (See Figure 2-3.)

Figure 2-3. Managed Server Start with Node Manager

graphics/02fig03.gif

Node Manager functions very much like a Unix daemon in that it monitors an IP address and port for requests coming in across the network. [2] By default, the port it listens on is 5555, not 7001 (see Figure 2-3). Both the port and the IP address Node Manager monitors are configurable. Upon receipt of a request from the Server Console, it will attempt to either start or stop WebLogic on the remote machine, as appropriate. Regardless of the number of servers on a particular machine, only one instance of node manager needs to be running.

[2] It fails to qualify for daemon-hood on a couple of technicalities.

This section discusses the configuration, installation, and use of the Node Manager utility. Configuration is accomplished using environment variables and command line arguments. The command-line arguments in the examples below may either be typed in the Java command line used to start Node Manager or incorporated into the script with which you start Node Manager.

To get the most value out of Node Manager, you will want to configure it so that it is started automatically by the host operating system at boot time.

Environment Variables

Node Manager needs to be made aware of the locations of both Java and WebLogic in the directory tree. This is accomplished by setting environment variables. The exact values you need to set are system-specific. Typical examples are provided below:

For Windows:

JAVA_HOME is the home directory of the Java installation used by WebLogic. For example

 set JAVA_HOME=C:\bea\jdk131 

WL_HOME is the home directory of the WebLogic installation you're trying to use WebLogic to start.

 set WL_HOME=C:\bea\wlserver6.1 

PATH is the list of directories that will be searched for WebLogic executables and Java classes.

 set PATH=%WL_HOME%\bin;%JAVA_HOME%\bin;%PATH% 

For Unix:

WL_HOME is the home directory of the WebLogic installation that you're trying to use Node Manager to start. It should have been set when you installed WebLogic.

 $WL_HOME=/BEA/wlserver6.1 

PATH is a variable containing a list of directories to be searched by the operating system when it is attempting to execute a program. It should include both the /bin directory under the WebLogic installation and the /bin directory under the $JAVA_HOME directory.

 PATH=$WL_HOME/bin:$JAVA_HOME/jre/bin:$JAVA_HOME/bin:$PATH 

In addition, you need to set the environment variables pointing to the Unix libraries used by WebLogic. This path is slightly different for each variation of Unix, but should always be found in the /lib directory under the $WL_HOME directory. For Linux, we have:

 export SHLIB_PATH=$SHLIB_PATH:$WL_HOME/lib/linux/i686 

Basic Starts

As with any Java program, you can, of course, start Node Manager from the command line. However, the number of options involved in a typical start will quickly make that tedious . For that reason, your WebLogic installation comes with a scipt you can use to start NodeManager. It is found in the /config directory under WebLogic Home. For Windows, the script is

 startNodeManager.cmd 

For Unix, it is

 startNodeManager.sh 

Starting Node Manager via script is usually preferable to starting it by hand from the command line. However, in both cases you have to tell the default script what IP address to monitor before it will do anything.

This is accomplished with the listenAddress command-line option. Add the following to the start command [3] found within that script to tell Node Manager which IP address to monitor:

[3] If you're not comfortable with programming jargon, this is going to be the line in the startNodeManager script that starts with "java" and ends with "weblogic.nodemanager.NodeManager."

 -Dweblogic.nodemanager.listenAddress=192.168.100.1 

On that IP address the default port monitored is 5555. You can change it as follows :

 -Dweblogic.nodemanager.listenPort=5555 

As mentioned earlier, it is also possible to start Node Manager from the command line. Your CLASSPATH variable must be set so that Java can find the classes, but otherwise Node Manager is invoked just like any other program:

 java weblogic.nodemanager.NodeManager 

The node manager will need to know the BEA home directory:

 -Dbea.home=/bea/home/directory 

SSL

Node Manager uses the Secure Socket Layer (SSL) to encrypt all communication between it and the Administration server. In order to communicate via SSL, [4] Node Manager needs to know two things: where the certificate files are stored, and whether they are of type RSA or DSA. To specify the location of the certificate, start Node Manager with the following option.

[4] Basics of the Secure Socket Layer are provided in the Introduction.

 -Dweblogic.nodemanager.certificateFile=/path/to/file 

The default type of the certificate is RSA. If you wish to use a DSA certificate, you should tell Node Manager about it with the following parameter:

 -Dweblogic.nodemanager.certificateType=DSA 

The trusted authority that is used to validate the certificate you are using should also be specified in a file on the local machine. The trusted authority is the third party that client machines refer to when validating the certificate.

 -Dweblogic.nodemanager.trustedCerts=/path/to/authority 

Finally, you may wish to provide the pass phrase for accessing your encrypted private key. It is permissible to do so, though you should take into account the security risks inherent in storing a pass phrase in an unencrypted file:

 -Dweblogic.nodemanager.certificatePassword=1mn0tsaf3 

Logging

Normally, when you start up or shut down a server you can expect to see a certain amount of message traffic displayed to the screen. Node Manager intercepts these messages and saves them in a log file. These files are created and named automatically; however, you can specify the directory in which they are stored with the savedLogsDirectory option:

 -Dweblogic.nodemanager.savedLogsDirectory=/path/to/directory 

Installing Node Manager

It is best to configure the host operating system to start Node Manager when the system is bootedif not, all you've done is push the who-starts-the-remote-service problem back one step. On Unix machines this is usually accomplished by invoking the startNodeManager.sh script when you enter your target run level. You might also consider writing a cron script that checks every so often to see if Node Manager is running and starts it if it is not.

In Windows environments, you will instead be starting Node Manager as a Windows service. This is accomplished as follows:

  1. Locate the installNtService.cmd script that was included with your installation and copy it to installNmNtService.cmd

  2. Edit the script and make the following changes:

    • Change the startup class from weblogic.Server to weblogic.nodemanager.NodeManager .

    • Add command-line options appropriate for your system.

    • Change the -svcname to something appropriate for Node Manager.

  3. After you've made the changes, you can install Node Manager as an NT service by running the script.



BEA WebLogic Server Administration Kit
BEA WebLogic Server Administration Kit (Prentice Hall PTR Advanced Web Development)
ISBN: 0130463868
EAN: 2147483647
Year: 2002
Pages: 134
Authors: Scott Hawkins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net