![]() |
![]() |
e-docs > WebLogic Server > Creating and Configuring WebLogic Server Domains > Managing Server Availability with Node Manager |
Creating and Configuring WebLogic Server Domains
|
Managing Server Availability with Node Manager
The following sections describe how to configure and use Node Manager in a WebLogic Server domain:
Node Manager is a standalone Java program provided with WebLogic Server that you can use to:
The following sections describe the environment in which you run Node Manager.
Node Manager Runs on Machines that Host Managed Servers
To use Node Manager, you must configure and run one Node Manager process on each machine that hosts Managed Servers. You can manage multiple Managed Servers that reside on a single machine with a single Node Manager process. You can also control Managed Servers in different domains with a single Node Manager process.
Node Manager Should Run as a Service
Configure Node Manager to run as a daemon on UNIX machines or as a Windows service on Windows-based machines (see Starting Node Manager as a Windows Service). This ensures that Node Manager is available after a machine reboot.
Note: You cannot use Node Manager to start or kill an Administration Server. In a production environment, there is no need run Node Manager on a machine that runs an Administration Server, unless that machine also runs Managed Servers.
Node Manager Uses SSL to Communicate with Administration Servers
Communication between Node Manager and the Administration Server requires the Secure Socket Layer protocol, which provides authentication and encryption. You cannot use Node Manager features with an unsecured communication protocol.
Native Support for Node Manager
BEA provides native Node Manager libraries for Windows, Solaris, and HP UX operating systems. For UNIX operating systems other than Solaris and HP UX, you must disable the weblogic.nodemanager.nativeVersionEnabled option at the command line when starting Node Manager. See Starting Node Manager for more information.
The following figure shows the Node Manager architecture for a single WebLogic Server domain.
Figure 5-1 Node Manager Architecture
Node Manager works with other processes in a WebLogic Server domain to help you start and stop Managed Servers.
Users can issue requests to start, suspend, or shut down a Managed Server using the Administration Console. These requests are dispatched by the domain's Administration Server to the Node Manager process on the machine that hosts the Managed Server.
The Administration Server can also accept programmatic requests to change the state of a Managed Server. These requests, initiated by JMX clients such as the weblogic.Admin command-line utility, are dispatched to the Node Manager process on the machine that hosts the Managed Server.
Node Manager verifies that the actions requested by the Administration Server and programmatic clients are feasible, based on locally cached information on the state of Managed Servers it previously started. After verifying incoming requests, Node Manager forwards them to the target Managed Server for execution.
The target Managed Server performs the requested operation—shutdown, suspend, or resume. If the Managed Server fails to respond to a shutdown request from the Node Manager, the Node Manager process itself performs the shutdown.
A Node Manager is not part of a particular domain. You can use a single Node Manager process to start Managed Servers in any domain that it can access.
Node Manager starts a Managed Server in a dedicated process on the target machine, separate from the Node Manager and Administration Server processes. If you start a Managed Server using Node Manager, the associated status messages that are usually printed to STDOUT or STDERROR are displayed in the Administration Console and written to the Node Manager log file for that Managed Server, as described in Managed Server Log Files.
The following sections describe key Node Manager capabilities. These capabilities are subject to the requirements and limitations described in Prerequisites for Node Manager Capabilities.
Node Manager Starts and Stops Managed Servers
As described in Node Manager Architecture, requests initiated by Administration Console users or JMX clients are forwarded by the Administration Server to the Node Manager process on the machine that hosts the target Managed Server. Node Manager verifies the feasibility of each request it receives and dispatches the verified request to the target Managed Server.
Note: Node Manager always starts a Managed Server in its last runtime state, as described in Node Manager Ignores Server Startup Mode.
Node Manager Monitors Managed Servers that it Started
WebLogic Server 7.0 subsystems perform self-health monitoring. If one or more of its critical subsystems fail, a Managed Server sets its health state to "failed." Node Manager periodically checks the health state of each Managed Server that it started.
For instructions on how to control how often Node Manager checks the health state of a Managed Server, and the length of time it will wait for a response from the Managed Server, see Configure Monitoring, Shutdown and Restart for Managed Servers.
For more information about how a Managed Server monitors its health, see "Server Self-Health Monitoring".
Node Manager Can Kill Unavailable and Failed Managed Servers
Node Manager can optionally shut down a Managed Server that reports its health status as "failed" or that does not respond to a health state query. By default this behavior is disabled. For instructions on how to enable this feature, see Configure Monitoring, Shutdown and Restart for Managed Servers.
Node Manager Automatically Restarts Managed Servers
By default, Node Manager attempts to restart a Managed Server whose health state is "failed". You can:
Node Manager always starts a Managed Server in its last runtime state, as described in Node Manager Ignores Server Startup Mode.
Prerequisites for Node Manager Capabilities
Node Manager's ability to monitor the health of Managed Servers, and to automatically shutdown and restart Managed Servers is subject to these conditions:
The following scenarios exemplify the use of HostsMigratableServices. In Example 1, the value of HostsMigratableServices is not a factor in automatic restart of the Managed Server. In Example 2, the value of HostsMigratableServices is a factor in automatic restart of the Managed Server.
Node Manager Ignores Server Startup Mode
When Node Manager starts a Managed Server, either automatically or as a result of a user command or script, it does not use the startup mode configured for the server. (A Managed Server's startup mode can be specified with the -Dweblogic.management.startupMode command argument, or in the Administration Console on the Server's Configuration->General tab). Instead, Node Manager always starts a Managed Server in its last runtime state.
For example, if a Managed Server configured to start up in STANDBY mode fails while in the RUNNING state, Node Manager will automatically restart the server instance in RUNNING state (assuming Node Manager is configured to monitor the health of Managed Servers, and the prerequisites described in Prerequisites for Node Manager Capabilities are met.)
For more information on server startup mode, see "Starting and Stopping WebLogic Servers" in the Administration Guide.
The following tasks are required to use Node Manager in a WebLogic Server domain
After you perform these tasks, you can use Node Manager, via the Administration Console to explicitly start and stop Managed Servers. By default the following behaviors will be configured:
To tailor these configuration settings, follow the instructions in Configure Monitoring, Shutdown and Restart for Managed Servers
Set Up the Node Manager Hosts File
Node Manager accepts commands only from Administration Servers that reside on a trusted hosts. The trusted hosts for a Node Manager process are identified by IP address or DNS name in a file, which by default is named nodemanager.hosts and installed in the WL_HOME\common\nodemanager\config directory, where WL_HOME is the top-level installation directory for the WebLogic Server.
Note: You can specify a different name and location for the trusted hosts file using a Node Manager command-line argument. For more information, see Node Manager Command-Line Arguments.
nodemanager.hosts contains one line for each trusted host on which an Administration Server runs. By default, nodemanager.hosts file contains two entries:
localhost
127.0.0.1
To add or remove trusted hosts, edit the file with a text editor.
If you identify a trusted host by its DNS name, you must enable reverse DNS lookup when starting Node Manager. Reverse DNS lookup is enabled via the command-line argument:
-Dweblogic.nodemanager.reverseDnsEnabled=true
By default, reverse DNS lookup is disabled.
In a typical production environment Node Manager might not be running on the same machine as the Administration Server. Edit nodemanager.hosts to list only machines that host an Administration Server.
Configure SSL for Node Manager
Node Manager uses 2-way SSL to protect communications with Administration and Managed Servers. The configuration of SSL involves obtaining identity and trust for the Node Manager and each Administration and Managed Server with which the Node Manager will be communicating and then configuring the Node Manager, the Administration Server, and any Managed Servers with the proper identity and trust. In addition, the use of host name verification must be taken into consideration.
In WebLogic Server 7.0 and later, Node Manager uses the same certificate format and public key infrastructure used by WebLogic Server 7.0. (Prior to WebLogic Server 7.0, Node Manager used a single certificate file containing both a password-protected private key and user identity certificate.)
For general information about SSL, see "SSL: An Introduction" in Managing WebLogic Security. For instructions to configure SSL for Node Manager, see "Configuring SSL for the Node Manager" in Managing WebLogic Security.
Starting Node Manager with SSL
When you start a Node Manager process to use SSL, you must specify startup arguments that identify the keystore, password, and certificate files to use for SSL communication:
For example, to start Node Manager using the SSL configuration provided with the sample SSL certificate and key files:
java.exe -Xms32m -Xmx200m -classpath %CLASSPATH% -Dbea.home=c:\bea
-Dweblogic.nodemanager.keyFile=e:\bea\user_domains\mydomain\demokey.pem
-Dweblogic.security.SSL.trustedCAKeyStore=e:\bea\weblogic700\server\lib\cacerts
-Dweblogic.nodemanager.certificateFile=e:\bea\user_domains\mydomain\democert.pem
-Djava.security.policy=e:\weblogic700\server\lib\weblogic.policy
-Dweblogic.nodemanager.sslHostNameVerificationEnabled=false weblogic.nodemanager.NodeManager
See Node Manager Command-Line Arguments for information about all Node Manager command-line arguments.
Configure a Machine to Use Node Manager
Before using Node Manager you must create a machine definition for each machine that runs a Node Manager process.
Configure Startup Arguments for Managed Servers
When Node Manager starts a Managed Server, it uses startup command arguments, just as you do if you start a server instance at the Java command line or in a startup script. See "Starting and Stopping WebLogic Servers" in the Administration Guide for more information on individual arguments.
If you do not specify optional startup arguments for a Managed Server, Node Manager uses its own properties as defaults to start the server instance. Although these defaults are sufficient to boot a server, you should enter your own custom startup arguments to ensure that each server boots in a consistent and reliable manner.
To configure the startup arguments that Node Manager will use to start a Managed Server:
If you do not specify a Root Directory value, the default Node Manager work directory is used (generally WL_HOME\common\nodemanager).
WL_HOME/server/lib/weblogic_sp.jar
WL_HOME/server/lib/weblogic.jar
See "Starting and Stopping WebLogic Servers" in the Administration Guide for more information about class path requirements.
Configure Monitoring, Shutdown and Restart for Managed Servers
Follow these steps in this section to configure Node Manager features for:
Note: These features are available when the conditions described in Prerequisites for Node Manager Capabilities are met.
You start the Node Manager process manually, using the java command at an operating system prompt, or automate the process using scripts. In a production environment, make sure that Node Manager starts automatically when a machine is booted, by creating a startup script (for UNIX systems) or by setting up Node Manager as a Windows service.
Node Manager relies on the same environment variables and command-line options regardless of how you choose to start the Node Manager process.
Note: Always specify a minimum heap size of 32 megabytes (-Xms32m) when starting Node Manager to avoid running out of memory. The Node Manager start script and installNodeMgrSvc.cmd script automatically set this Java argument.
Starting Node Manager Using Start Scripts
BEA provides sample start scripts to help you begin using Node Manager. These scripts are installed in the WL_HOME\server\bin directory. The standard Node Manager start script is named startNodeManager.cmd on Windows systems and startNodeManager.sh on UNIX systems. The scripts set the required Node Manager environment values and start the Node Manager process.
When you first use the Node Manager start script, the script changes to the directory WL_HOME/common/nodemanager where WL_HOME is the WebLogic Server installation directory. Node Manager uses this directory as a working directory for storing output and log files. If you want to specify a different working directory, edit the start script with a text editor and set the value of the NODEMGR_HOME variable to a directory of your choice.
You will also need to edit the sample start script to make sure that the Node Manager startup arguments set the correct listen address and port number for your Node Manager process.
Starting Node Manager as a Windows Service
The directory WL_HOME\server\bin (where WL_HOME is the top-level directory for the WebLogic platform) contains two scripts for installing and uninstalling the Node Manager as a Windows service: installNodeMgrSvc.cmd and uninstallNodeMgrSvc.cmd.
To use either script, simply invoke the script name at the command line. installNodeMgrSvc.cmd creates a default Windows service for the Node Manager application named NodeManager_localhost_5555. As with the Node Manager start scripts described above, you may want to edit installNodeMgrSvc.cmd before running the script to change the service name or to use non-default environment variables or startup arguments.
uninstallNodeMgrSvc.cmd uninstalls the default node manager service. If you edit installNodeMgrSvc.cmd to change the listen port or hostname, make the same change to uninstallNodeMgrSvc.cmd so that it removes the correct service name.
Node Manager Environment Variables
Before starting Node Manager, you must set several different environment variables. One way to set all of the required environment variables for a domain is to run the environment setup scripts provided with WebLogic Server, as described in Starting Node Manager Using Start Scripts and Starting Node Manager as a Windows Service.
If you are starting Node Manager directly from the command line, use the information in the table below to set required environment variables.
Figure 5-2 Node Manager Environment Variables
Node Manager Command-Line Arguments
The basic syntax for starting start Node Manager is:
java [java_property=value ...] -D[nodemanager_property=value]
-D[server_property=value] weblogic.nodemanager.NodeManager
In the command line, a java_property indicates a direct argument to the java executable, such as -ms or -mx. If you did not set the CLASSPATH environment variable, use the -classpath option to identify required Node Manager classes.
Note: Always specify a minimum heap size of 32 megabytes (-Xms32m) with Node Manager to avoid running out of memory. The Node Manager start scripts installed with WebLogic Server automatically set this Java argument.
A nodemanager_property begins with the prefix weblogic.property and directly affects the behavior of the Node Manager process. The table below describes all Node Manager properties.
Table 5-1 Node Manager Properties
Specifies the path to the certificate file used for SSL authentication. |
||
Specifies the Java home directory that Node Manager uses to start Managed Servers on this machine. |
||
The path to the private key file to use for SSL communication with the Administration Server. |
||
The password used to access the encrypted private key in the key file. |
||
The address on which Node Manager listens for connection requests. Use weblogic.ListenAddress in place of this deprecated argument. |
||
The TCP port number on which Node Manager listens for connection requests. Use weblogic.ListenPort in place of this deprecated argument. |
||
The address on which Node Manager listens for connection requests. This argument deprecates weblogic.nodemanager.listenAddress. |
||
The TCP port number on which Node Manager listens for connection requests. This argument deprecates weblogic.nodemanager.listenPort. |
||
For UNIX systems other than Solaris or HP-UX, set this property to false to run Node Manager in non-native mode. This will cause Node Manager to use the start script specified by the StartTemplate property to start Managed Servers. |
||
Specifies whether entries in the trusted hosts file can contain DNS names (instead of IP addresses). |
||
Specifies the path in which Node Manager stores log files. Node Manager creates a subdirectory in the savedLogsDirectory named NodeManagerLogs. |
||
Determines whether or not Node Manager performs host name verification. |
||
For UNIX systems only, this property specifies the path of a script file used to start Managed Servers. Note: Node Manager will use the specified start script to start Managed Servers only if the NativeVersionEnabled property is set to false. StartTemplate is used only for Unix systems that do not have If you create your own start template script, refer to nodemenager.sh as an example.native Node Manager libraries. |
||
The path to the trusted hosts file that Node Manager uses. See Set Up the Node Manager Hosts File. |
||
Specifies the root directory of the WebLogic Server installation. This is used as the default value of -Dweblogic.RootDirectory for servers that do not have a configured root directory. |
Node Manager uses server_property values as default values when starting new Managed Server instances. The table below describes all server_property values.
Table 5-2 Server Properties Used by Node Manager
Note: If you wish to start Node Manager on a UNIX operating system other than Solaris or HP UX, you cannot have any white space characters in any of the parameters that will be passed to the java command line in starting Node Manager. For example, if you try to use the parameter
-Dweblogic.Name=big iron
the command fails due to the space character in the name big iron.
Starting and Stopping Managed Servers with Node Manager
These sections describe how to use Node Manager to:
Start and Stop Managed Servers Manually
You can start a Managed Server using the Administration Console if Node Manager is running on the machine that hosts the Managed Server.
When start a Managed Server in this fashion, Node Manager starts the server instance in a separate process. Messages that are usually printed to STDOUT or STDERROR when starting a WebLogic Server are instead displayed in the right pane of the Administration Console. These messages are also written to the Node Manager log file for that server, as described in Managed Server Log Files.
Node Manager always starts a Managed Server in its last runtime state, ignoring the server's configured startup mode. See Node Manager Ignores Server Startup Mode for more information.
To start a Managed Server using Node Manager:
Note: Node Manager is not required to use the Shutdown this server... or Force shutdown of this server... options. However, Node Manager is used to complete these shutdown tasks (if configured) if the server fails to respond to the shutdown request.
See "Starting and Stopping WebLogic Server" in the Administration Guidefor more information about server states.
Start and Stop All Managed Servers in a Domain or Cluster
You can start or shutdown all Managed Servers in a domain or cluster using the Administration Console if Node Manager is running on each machine that hosts the Managed Servers in the domain or cluster.
To start all Managed Servers in a domain or cluster:
If you start the entire domain from the Administration Console, the results displayed in the right pane will consist of a series of links to the results for each Managed Server that was configured for that domain.
To shutdown all Managed Servers in a domain or cluster:
Note: You cannot start or kill the Administration Server using Node Manager.
Start and Stop Servers Using weblogic.Admin
You can use the weblogic.Admin utility with the START, SHUTDOWN, and FORCESHUTDOWN commands to start and kill Managed Servers. To START a Managed Server, Node Manager must be running on the host. Node Manager is not required to SHUTDOWN or FORCESHUTDOWN a server instance; however, if the Managed Server cannot successfully complete a shutdown request, Node Manager performs the operation.
See "WebLogic Server Command-Line Interface Reference" in the Administration Guide for more information on using weblogic.Admin.
The following sections describe how to diagnose and correct Node Manager problems. Use the Node Manager log files to help troubleshoot problems in starting or stopping individual Managed Servers. Use the steps in Correcting Common Problems to solve problems in Node Manager configuration and setup.
Note: To reclaim disk space, you should periodically delete the accumulated log files from past Node Manager startup and shutdown attempts.
When you start WebLogic Server, startup or error messages are printed to STDOUT or STDERROR. These messages can be retrieved by right clicking on the server in the left pane of the Administration Console and selecting the option View Server log.
Node Manager saves these messages in the NodeManagerLogs directory. By default NodeManagerLogs is created in the directory where you start Node Manager. A separate log file subdirectory is created for each Managed Server that Node Manager starts on the machine. Each subdirectory uses the naming convention domain_server which designates the domain name and Managed Server name, respectively.
The domain's Administration Server also stores a copy of the Managed Server log files in the a directory name NodeManagerClientLogs. This directory is created one directory level above the Administration Server's root directory (by default, the directory in which you started the server). The NodeManagerClientLogs directory contains a subdirectory for each Managed Server you attempted to start via Node Manager. Each log in these subdirectories corresponds to an attempt to carry out some action, such as starting or killing the server process. The name of the log file includes a timestamp that indicates the time at which the action was attempted.
You can view the standard output and error messages for a server, as well as Node Manager's log messages for a particular Managed Server, using the console. Simply select the server that was started using manager, then select the Monitoring->Process Output tab.
Note: Because Node Manager creates a new log file (with unique timestamp) each time it starts, you should periodically remove the NodeManagerLogs subdirectory to reclaim the space used by old log files.
In WebLogic Server 7.0 Node Manager also generates its own log files, which contain Node Manager startup and status messages that were written to STDOUT in previous Node Manager versions. Node Manager log files are placed in the NodeManagerLogs\NodeManagerInternal subdirectory. The log files using the naming convention NodeManagerInternal_timestamp, where timestamp indicates the time at which Node Manager started.
The table below describes common Node Manager problems and their solutions.
Table 5-3 Troubleshooting Node Manager Problems
Error message: Could not start server 'MyServer' via Node Manager - reason: 'Target machine configuration not found'. |
You have not assigned the Managed Server to a machine. Follow the steps under Configure a Machine to Use Node Manager. |
Error message: <SecureSocketListener: Could not setup context and create a secure socket on 172.17.13.26:7001> |
The Node Manager process may not be running on the designated machine. See Starting Node Manager. |
I configured self-health monitoring attributes for a server, but Node Manager doesn't automatically restart the server. |
To automatically reboot a server, you must configure the server's automatic restart attributes as well as the health monitoring attributes. See Configure Monitoring, Shutdown and Restart for Managed Servers and Starting Node Manager. In addition, you must start Managed Servers using Node Manager. You cannot automatically reboot servers that were started outside of the Node Manager process (for example, servers started directly at the command line). |
Applications on the Managed Server are using the wrong directory for lookups. |
Applications deployed to WebLogic Server should never make assumptions about the current working directory. File lookups should generally take place relative to the Root Directory obtained with the ServerMBean.getRootDirectory() method (this defaults to the "." directory). For example, to perform a file lookup, use code similar to String rootDir = ServerMBean.getRootDirectory(); File f = new File("foo.in"); If an application is deployed to a server that is started using Node Manager, use the following method calls instead: String rootDir //application root directory The ServerStartMBean.getRootDirectory() method obtains the Root Directory value that you specified when configuring the server for startup using Node Manager. (This corresponds to the Root Directory attribute specified the Configuration->Remote Start page of the Administration Console.) |
Node Manager defines its own, internal Managed Server states for use when restarting a server. You may observe these states when working with Node Manager in a domain:
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |