In this post, I am going to describe node manager process and its interaction with WebLogic server instances. This post covers mostly theoretical parts, it does not includes instructions on how to perform tasks related to node manager.
In WebLogic Server environment, the Admin Server does not connect to the managed servers directly. A separate utility named "node manager" should be running in each machine for helping this purpose.
The main task of node manager is to provide a remote controller interface for controlling of the WebLogic Server instances (Admin Server and managed server instances) which are located in the same machine as the node manager process. It is not mandatory to have a node manager in a machine if you do not want to control managed server instances through Admin Server. Also it is possible to have only one node manager for all the domains in a machine.
It is recommended to install node manager as an operating system service or daemon. Then the node manager will be automatically restarted when a system failure or reboot of the machine happens.
Node manager is required if you want following features,
Usually, the node manager gets the start/shutdown commands for starting/shut downing managed servers from the Admin Server. Then node manager is the process that actually start or shutdown the relevant managed server.
In WebLogic Server environment, the Admin Server does not connect to the managed servers directly. A separate utility named "node manager" should be running in each machine for helping this purpose.
The main task of node manager is to provide a remote controller interface for controlling of the WebLogic Server instances (Admin Server and managed server instances) which are located in the same machine as the node manager process. It is not mandatory to have a node manager in a machine if you do not want to control managed server instances through Admin Server. Also it is possible to have only one node manager for all the domains in a machine.
It is recommended to install node manager as an operating system service or daemon. Then the node manager will be automatically restarted when a system failure or reboot of the machine happens.
Node manager is required if you want following features,
- If you want to start managed servers from Admin console.
- For supporting High Availability.
- For Whole Server Migration.
- For Automatic Service Migration.
Purpose of Node Manager Process:
- Allow a remote or a local client to stop/start WebLogic server instances in the machine which runs the Node Manager process (mainly, but not necessarily from the Admin Server)
- start, shutdown Admin Server instance
- start, suspend, shutdown managed server instances
- Automatically restart failed WebLogic server instances which were abnormally exited, if following conditions met,
- the failed server instance was started by the node manager.
- AutoRestart value of this server instance is set to true. (AutoRestart property of nodemanager's startup.properties file in <DOMAIN_HOME>/servers/<server_name>/data/nodemanager folder )
- Number of max allowed restart is not yet passed. (RestartMax property of nodemanager's startup.properties file).
- Allow monitoring of the health status of WebLogic servers from a remote or the local machine. (mainly, but not necessarily from the Admin Server)
- Retrieve server logs and node manager logs.
Tip: you can access the node manager (tested for a Plain Node Manager in WL 10.3.6) through a program like netcat, and then execute plain text commands to control the servers and monitor servers.
e.g:
~# nc <MACHINE_IP> 5556
domain <your_domain_name>
+OK Current domain set to ‘<your_domain_name>’
getStates
-ERR Must login to a domain first
user <weblogicuser>
+OK NM usr set to '<weblogicuser>'
pass <weblogicuser_password>
+OK Password accepted
getStates
+OK managed1=RUNNING managed2=UNKNOWN AdminServer=UNKNOWN
There are two versions of node manager processes.
Versions of Node Manager
Java based node manager
Java-based node manager process runs in a JVM instance. A Java-based node manager provides more security than a script based node manager.
- Java-based node manager supports both Windows and UNIX operating systems.
- Database-less leasing (consensus leasing) is faster when using a Java-based node manager.
- Using inetd in UNIX, java-based node managers can be configured to restart automatically when receiving a request on a configured port.
- Determines its configuration from nodemanager.properties file.
Script based node manager
You can managed remote server instances in a network through ssh using a script-based node manager (a script named wlscontrol.sh), using the scripts provided in this node manager version.
- Script-based node manager only supports UNIX operating systems.
- Automatic server migration is only supported by script-based node manager.
- The node manager can control servers in remote machines through a set of scripts copied to those remote machine.
- It requires only a smaller foot print than java-based node manager.
- It supports SSH for security and setting up security is easier than setting up SSL for java based node manager.
- It supports SSH or RSH for connection.
Following command line option should be added to Admin Server startup parameters in order to use SSH type of script based node manager.
See http://docs.oracle.com/cd/E12840_01/wls/docs103/nodemgr/script_nodemgr.html and "Running Script-based Node Manager" in https://docs.oracle.com/cd/E24329_01/web.1211/e21050/starting_nodemgr.htm#NODEM214 for more details about Script based node manager.
-Dwhere %H = host name of ssh server, %S = WebLogic server name, %D = WebLogic domain name, %R = domain directory, %C = node manager script command. For RSH type, the ShellCommand to use is relevant RSH command.weblogic.nodemanager.ShellCommand='ssh -o PasswordAuthentication=no %H wlscontrol.sh -d
%D
-r
%R
-s
%S
%C'
See http://docs.oracle.com/cd/E12840_01/wls/docs103/nodemgr/script_nodemgr.html and "Running Script-based Node Manager" in https://docs.oracle.com/cd/E24329_01/web.1211/e21050/starting_nodemgr.htm#NODEM214 for more details about Script based node manager.
Node Manager Types
There are several node manager types which supports different level/type of security for node manager communication.
Node Manager Operations
Please see https://docs.oracle.com/cd/E28280_01/web.1111/e13740/overview.htm#NODEM137 for more detailed explanation.
Starting Admin Server using Node Manager
- A node manager client authenticate to the Node Manager using node manager user name and password (e.g. nmConnect from WLST). Node Manager authenticates the given node manager user credentials using nm_password.properties file.
- Then Node Manager receives a command to start Admin Server from the node manager client (e.g. nmStart from WLST). This command provides the server name, domain name, server user credentials and any additional start-up properties.
- Node Manager determines the domain directory for the Admin Server from nodemanager.domains file and authenticates the given user credentials using a local file which contains the encrypted user credentials.
- Node Manager creates relevant directories (server_name/logs, server_name/security, server_name/data/nodemanager etc.) and obtains start-up properties for the Admin Server.
- Then it saves encrypted user name, password etc in boot.properties file.
- It saves the startup properties obtained from Admin Server configuration in startup.properties.
- Node Manager creates Admin Server process and start monitoring it.
- Admin Server process gets domain configuration data from its config folder.
Starting a managed server using Node Manager
This process can be done either from Admin Console, WLST console or another node manager client. Following steps mentions how to start the server from Admin console.
- A user issues a start command from Admin Console to start a managed server.
- Then Admin Server connects to the node manager which is located on the same machine as the targeted managed server, authenticate to the node manager.
- Then Admin Server sends the start command for starting the managed server to the node manager (with server name, username/password for connecting to server and other start-up properties).
- Node manager starts the managed server process.
- Managed server contacts the Admin Server to check for updates to its configuration information.
- If there is any update to the domain configuration, managed server updates its local cache of configuration from the update it got from the Admin Server.
Restart Admin Server using Node Manager
- Node Manager determines from the exit code of Admin Server process that it needs to restart the Admin Server.
- Node Manager obtains the user name and password value needed for starting the Admin server from the boot.properties file, and the start-up properties from <servername>/data/nodemanager/startup.properties file.
- Node Manager uses the above retrieved information and starts the Admin Server process.
- Admin Server reads its configuration data and starts up.
Restart a managed server using Node Manager
- Node Manager determines from the last known status of the managed server process (+ other node manager settings) that it needs to restart that managed server.
- Node Manager retrieves the user name and password value needed for starting the managed server from the boot.properties file, and the startup properties from <servername>/data/nodemanager/startup.properties file.
- Node Manager uses the above retrieved information and starts the managed Server process.
- Managed server contacts the Admin server to check for updates of the configuration data. If it get any updates, it update its local cache of config directory with the received updates.
- If managed server fails to contact the Admin Server and if the Managed Server Independence Mode (MSI) is enabled, the managed server uses its locally cached configuration data.
Shutdown a server instance using Node Manager
- An authorized user connects to the Admin console and issues the shutdown command for a managed server.
- Then Admin Server issues shutdown command directly to the managed server. Then managed server perform the shutdown sequences for Graceful Shutdown procedure.
- If Admin server failed to contact the managed server in above step, then it connects to the node manager and issues the shutdown command to the node manager for shutting down the managed server.
- Node manager asks Operating System to kill the managed server process.
- Operating system kills the managed server process.
Important files and folders related to node manager
References:
- https://docs.oracle.com/cd/E28280_01/web.1111/e13740/overview.htm#NODEM127
- http://docs.oracle.com/cd/E13222_01/wls/docs90/server_start/nodemgr.html
- Java-based Node Manager - https://docs.oracle.com/cd/E14571_01/web.1111/e13740/java_nodemgr.htm#NODEM177
- Script-based Node Manager - http://docs.oracle.com/cd/E12840_01/wls/docs103/nodemgr/script_nodemgr.html
- Running Script-based Node Manager - https://docs.oracle.com/cd/E24329_01/web.1211/e21050/starting_nodemgr.htm#NODEM214
- Running Script-based Node Manager - http://docs.oracle.com/cd/E13222_01/wls/docs90/server_start/nodemgr.html#1081981
- WLST commands for Node Manager - https://docs.oracle.com/middleware/1212/wls/WLSTC/reference.htm#WLSTC470