Managing Your WebLogic Servers Using the Node Manager
When you have a production WebLogic domain consisting of distributed managed servers, it is important for critical tasks such as starting, stopping, killing, and restarting the managed servers to be performed in the most efficient manner. Rather than creating your own scripts to perform these
The Node Manager, as shown in Figure 24.23, is a standalone Java program that can be leveraged to improve the availability of your distributed managed servers within a WebLogic domain by performing the following automated administration tasks: Figure 24.23. The architecture and operation of a Node Manager within a WebLogic domain.
Note
You cannot automatically restart managed servers that were
You can use the Administration Console to shut down a managed server, but you cannot use it to start a managed server without
As
Configuring the Node Manager on a Machine Node
Now that you have learned the objectives and reasons for using a Node Manager within a distributed WebLogic domain, the
The steps in the following sections guide you through the process of configuring a Node Manager on the machine nodes where your managed servers are located.
Step 1: Configuring Your Trusted
|
|
Node Manager Startup Variables and Properties |
Description |
|---|---|
|
%NODEMGR_HOME% |
The Node Manager working directory for storing output and log files |
|
%JAVA_HOME% |
The root directory of the installed JDK used to start the Node Manager |
|
%DOMAIN% |
The root directory of the managed server domain |
|
%MEM_ARGS% |
The memory arguments you want to pass to the JVM |
|
-Dbea.home |
The directory where the BEA license files are located |
|
-Djava.security.policy |
The path to the WebLogic security policy file |
|
-Dweblogic.nodemanager.sslHostNameVerificationEnabled |
Determines if the Node Manager
|
|
-Dweblogic.nodemanager.javaHome |
The Java home directory that Node Manager uses to start the managed servers |
|
-Dweblogic.nodemanager.reverseDnsEnabled |
Determines if DNS names will be used instead of an IP address for the listen port |
|
Dweblogic.ListenAddress |
The address on which Node Manager listens for connection requests |
|
Dweblogic.nodemanager.keyFile |
The path to the private key file to use for SSL communication |
|
Dweblogic.security.SSL.trustedCAKeyStore |
The path to the KeyStore that contains the certificates of trusted authorities |
|
Dweblogic.nodemanager.certificateFile |
The path to the certificate file used for SSL authentication |
The following are sample values that can be assigned to the environment variables and properties described in Table 24.3:
WL_HOME =C:\bea\weblogic700 NODEMGR_HOME=% WL_HOME %\common\nodemanager JAVA_HOME=C:\bea\jdk131_03 DOMAIN=c:\bea\user_projects MEM_ARGS=-Xms32m -Xmx50m -Djava.security.policy=% WL_HOME %\ server\lib\weblogic.policy -Dweblogic.nodemanager.sslHostNameVerificationEnabled=false -Dweblogic.nodemanager.javaHome=%JAVA_HOME% -Dweblogic.nodemanager.sslHostNameVerificationEnabled=FALSE weblogic.nodemanager.reverseDnsEnabled=TRUE -Dweblogic.ListenAddress=SOCRATES -Dweblogic.ListenPort=7266 -Dweblogic.nodemanager.javaHome=%JAVA_HOME% -Dweblogic.nodemanager.keyFile=c:\bea\user_projects\objectmind\demokey.pem -Dweblogic.nodemanager.certificateFile=c:\bea\user_projects\objectmind\democert.pem
After you appropriately edit the Node Manager startup arguments, you can start the Node Manager from the command line by executing the startNodeManager.cmd command, as shown in Figure 24.25.
The script that is used to create a Node Manager service, named installNodeMgrSvc.cmd , is located in the WL_HOME \server\bin directory. You need to edit this file before it can be invoked, similar to the startNodeManager.cmd script, to ensure the Node Manager's service name and startup arguments are set according to your WebLogic environment.
You also need to reflect the changes you make in the uninstallNodeMgrSvc.cmd file, which is the script used to uninstall the Node Manager service.
After the Node Manager service is created, you can start and stop it using the Windows Service Manager.
After a Node Manager is successfully started on a machine, you can engage in starting one, multiple, or a cluster of managed servers on that machine in the context of a WebLogic domain using the Administration Console.
Note
All managed servers you intend to remotely start must be configured as described earlier in the section "Step 4: Specifying the Managed Servers Startup Information."
To start a managed serverfor example, mServer that was created earlier in this chapterusing the Administration Console, follow these steps:
From the Servers node, select the name of the configured server you want to start (mServer).
Select the Control, Start/Stop tab in the right pane.
Click the Start This Server link.
Click Yes or No to verify your selection.
When you start a managed server using the Administration Console via the Node Manager, you can view the startup messages using the Details tab, as shown in Figure 24.26.
To stop the server, you can perform the same steps except that you select the shutdown option. You can also use the Administration Console to start and stop all the managed servers in a cluster or in a domain, as long as the managed servers are configured for remote start.
The Node Manager always starts or restarts a managed server in its last runtime state, regardless of the startup mode you have specified.
If you incur any problems starting a Node Manager or while starting or stopping managed servers via the Node Manager, reviewing the log files associated with Node Manager should be your first task in diagnosing the root cause of the problem. These files hold
The log files
Each time a Node Manager is started, the related startup and status messages are written to a unique log file named NodeManagerInternal_ timestamp , which is located in the NodeManagerInternal subdirectory of the NodeManagerLogs directory. You should view this file using a text editor to ensure there are no problems with the startup or operation of the Node Manager.
Tip
Because the NodeManagerInternal_ timestamp file is created each time you start a Node Manager, whether or not the startup process is successful, it is good practice to delete the log files that are no longer required.
For each managed server that is successfully started using the Node Manager, a separate log file subdirectory is created under the NodeManagerLogs directory. The naming convention used for these managed server directories is domain _ server , where domain represents the name of the domain and server represents the name of the managed server.
The files generated for each started managed server in this directory are as
Managed_Server_Name_pid Stores the process ID of the managed server to enable the administration server to kill the managed server via the Node Manager.
config.xml
Is the configuration property file that is used to start the managed server. This subset of the
Managed_Server_Name_ log Stores the startup information of the managed server.
Managed_Server_Name_ error_log Stores any error messages related to the managed server.
Caution
BEA recommends not deleting this file when a managed server is running.
Alternatively, you can also view the log files on the administration server. The NodeManagerClientLogs directory, which is located in the root directory of the administration server, contains a log file subdirectory for each managed server that is started via the Node Manager.
Tip
If you are having problems starting a managed server via the Node Manager for the first time, there is a possibility that no managed server log files will be generated because this depends on how far the startup process goes before it fails. For this reason, you should initially review the Node Manager log ( NodeManagerInternal_ timestamp ) if you have problems starting a managed server.
The Self-Health monitoring capability is a new feature of the WebLogic Server; it enables decoupled critical subsystems such as the WebLogic Server Kernel, JMS, and JTA to provide feedback on their health to determine the overall health of a WebLogic Server instance.
When a WebLogic Server starts, all self-healthenabled subsystems register
To determine the overall health of a WebLogic Server instance, the Health Monitoring System periodically (the default is 180 seconds) queries the health state attribute of the runtime MBeans associated with self-healthenabled subsystems. If any of these subsystems are found to be in a Failed state, the overall state of the associated WebLogic Server instance is also
To improve the reliability and availability of your WebLogic domain, you can use the Health Monitoring System in conjunction with the Node Manager to ensure managed servers that are deemed to be in a Failed state are immediately shut down and, if required, restarted again. A Node Manager can deem a managed server to be in Failed state for a number a reasons; the following are some examples:
The managed server has crashed.
The managed server is hung and hence not responding.
The managed server is not responding to any health check queries, which could be because it is busy.
One or more critical self-health monitoring services have declared a Failed state.
The only caveat is that the Node Manager can monitor the health state of only those managed servers it has started.
To configure a Node Manager to monitor a managed server's health, you need to edit the managed server's Health Monitoring attributes, which you can do using the Administration Console as follows:
From the Administration Console, select the name of the managed server you want to configure for automated health monitoring using the Node Managerfor example, mServer.
Select the Configuration, Health Monitoring tab.
From the displayed managed server's automated restart and monitoring attributes, as shown in Figure 24.27, enable and edit those that pertain to your health monitoring requirements using the attribute descriptions in Table 24.4 as a guide.
Click Apply.
|
Health Monitoring Attribute |
Description |
|---|---|
|
Auto Restart |
This attribute should be enabled to ensure the Node Manager restarts a managed server that has been shut down. (This attribute is enabled by default.) |
|
Auto Kill If Failed |
This attribute enables the Node Manager to automatically kill a managed server after its health state has been deemed to be in a Failed state. |
|
Restart Interval |
If Auto Restart is enabled, this attribute specifies the length of time (seconds) during which the Node Manager will attempt to restart the managed server. The default is 3600 seconds or one
|
|
Max Restarts Within Interval |
If Auto Restart is enabled, this attribute specifies the maximum number of times a Node Manager can restart the managed server during the Restart Interval. The default is 2. (If a managed server needs to be restarted more than twice during the Restart Interval, there is a high degree of probability the managed server will continue to fail, and the root cause of the problem will need to be immediately
|
|
Health Check Interval |
This attribute specifies the interval of time (seconds) between which periodic
|
|
Health Check Timeout |
This attribute specifies the length of time (in seconds) the Node Manager will wait for a response to the health check query after which it will deem the monitored managed server to be in a Failed state. The default is 60 seconds. (This value should be based on the managed server's response time during its peak transaction period, which can prevent the server from being prematurely deemed to be in a Failed state.) |
|
Restart Delay Seconds |
This attribute specifies the duration of time the Node Manager will wait after a managed server has been restarted before it initiates its health monitoring activities. The default is 120 seconds. (You should set this attribute based on a proven time period for the successful start and the deployed application activity of a managed server.) |
Note
Disabling the Auto Restart and enabling the Auto Kill If Failed attributes will cause a Node Manager to kill a Failed managed server if a Failed state is
Because a Node Manager can apply the Health monitoring and