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 ManagerOwing 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
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.
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 VariablesNode 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:
Basic StartsAs 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:
-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 SSLNode 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.
-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 LoggingNormally, 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 ManagerIt 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:
|