Monday 9 January 2012

WebLogic 11g: Node Manager Overview


Overview


* Not associated with a specific WebLogic domain.
* Is Associated with a machine.
* Same node manager can control server instances in any WebLogic Server domain, as long as server instances reside on the same machine as the Node Manager.

Node Manager Types

Java-based Node Manager

* Version can be found in nodemanager.properties
* Compare to script-based:
- More secure.
- Faster due to consensus leasing.

Script-based Node Manager

* Not supported in Windows OS.
* Compare to Java-based:
- Easier to configure (just copying, existing SSH connections).
- Smaller footprint.

Access Node Manager

* Admin Console
* WLST

Node Manager Function

* Start/Stop/Suspend/Restart managed server.
* Auto restart failed Admin/Managed servers that were started by node manager.
* Monitor servers.
* View log files.

Node Manager Config Files

WL_HOME/common/nodemanager Directory
nodemanager.properties
* Used by Java-based Node Manager.
nodemanager.domains
* Contains domain name and directory mappings.
nm_data.properties
* Contains symmetric encryption key.
DOMAIN_HOME/config/nodemanager Directory
nm_password.properties
* Contains NM username and password.
DOMAIN_HOME/servers/server_name/data/nodemanager Directory
boot.properties
* Contains user credentials when starting a server.
startup.properties
* Used to start/restart managed servers.
* Contains properties copies from Admin Server.
* One file for each managed server.
server_name.addr
* Contains IP address added when a server starts or is migrated.
* Generated after server IP address is successfully brought online during migration.
* Deleted when IP address is brought offline.
server_name.lck
* Generated by each server.
* Contains internal lock id.
server_name.pid
* Contains process id for each server.
server_name.state
* Contains server's current state.

Log Files

nodemanager.log
* For Java-based node manager only.
* Located in WL_HOME/common/nodemanager directory.
* Can be viewed by
- Admin Console: Machines > Monitoring > Node Manager Log page.
- WLST nmlog command.
server_name.out
* Server specific log file.
* Located in domain_name/servers/server_name/logs directory.
* Can be viewed by
- Admin Console: Diagnostics > Log page.
- WLST nmServerLog command.

General Node Manager Configuration

Configure Machine to Run NM

Default Behavior

* NM is ready to run after WebLogic Server installation if you
- run NM and AS on the same machine.
- use the demo SSL config.
* NM can be started using NM via AS.
* NM monitors the MS that it started.
* Auto restart of MS is enabled.

Enroll WLST Client in Prod Environment

* Start AS.
* Update NM credentials.
- Click domain_name -> Security -> General tab.
- Click Advanced arrow.
- Update NodeManager Password.
* Invoke WLST and use connect command to connect to AS.
* Use nmEnroll to envroll WLST client.
- Syntax:
nmEnroll([domainDir], [nmHome])
* Sample run:
cd /opt/oracle/Middleware/home_11gr1/wlserver_10.3/common/bin
./wlst.sh

nmConnect('weblogic', 'welcome1', 'localhost', '5556', 'soa_domain', '/opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain','ssl')
Connecting to Node Manager ...
Successfully Connected to Node Manager.

nmEnroll('/opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain', '/opt/oracle/Middleware/home_11gr1/wlserver_10.3/common/nodemanager')
Enrolling this machine with the domain directory at /opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain ...
Successfully enrolled this machine with the domain directory at /opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain.
* Run nmEnroll
- on each machine that is running a MS.
- on each domain directory on each machine.

Specify Node Manager Username and Password

* Maintained in nm_password.properties file.
* nm_password.properties is created by nmEnroll command.
* Use Admin Console to change username and password.
* Manual editing of nm_password.properties file requires NM restart.

Configure a Machine to user NM

* Config machine definition for each machine that runs a NM process
- Login Admin Console.
- Go to Environment > Machines > machine_name > Node Manager.
- Set Listen Address and Listen Port.

Config nodemanager.domains File

* This file specifies domains that a NM instance controls in the format:
domain-name=domain-directory
cd /opt/oracle/Middleware/home_11gr1/wlserver_10.3/common/nodemanager
cat nodemanager.domains

soa_domain=/opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain
* Client can only execute commands for the domains listed in this file.

Config Remote Startup Arguments

* In Admin Server's Server > Configuration > Server Start page.
* If NM is run as a Windows Service, you must config following JVM property for each MS. Otherwise, NM can not restart MS.
- For Sun JVM: -Xrs
- For JRockit: -Xnohup

Config Server Startup Properties

* Defined in DOMAIN_HOME/servers/server_name/data/nodemanager/startup.properties file.

Define Admin Server Listen Address

* Make sure that a listen address is defined for each Administration Server that will connect to the Node Manager process.
* If the listen address for an Administration Server is not defined, when Node Manager starts a Managed Server it will direct the Managed Server to contact localhost for its configuration information.
* Set the Listen Address using the Servers > Configuration > General page in the Administration Console.

Set NM Env Variables

* See samples startup script at
/opt/oracle/Middleware/home_11gr1/wlserver_10.3/server/bin/ startNodeManager.sh

Config Java NM

Reconfigure Startup Service for Windows Installations

* Go to WL_HOME\server\bin directory.
* Delete the existing service using uninstallNodeMgrSvc.cmd script.
* Edit installNodeMgrSvc.cmd to specify Node Manager's listen address and listen port.
* Make the same edit to uninstallNodeMgrSvc.cmd.
* Run installNodeMgrSvc.cmd to re-install Node Manager as a service, listening on the updated address and port.

Config Script NM

Start NM

Start Java-based NM Using Scripts

Sample NM Startup Script

* Located in WL_HOME\server\bin directory:
- Win: startNodeManager.cmd
- Unix: startNodeManager.sh
* Working directory is: WL_HOME/common/nodemanager

Stop Java-based NM

* Ctr-C or close the command shell.
* Use WLST stopNodeManager.
- Need to set in nodemanager.properties.
QuitEnabled=true

Use NM

Start Admin Server with NM

* Start NM.
* Invoke WLST.
* nmConnect to NM.
* nmStart Admin Server.

Start Managed Server with NM

* Start NM.
* Invoke WLST.
* nmConnect to NM.
* start Managed Server.

Start Managed Server with NM without Admin Server

* Used when Admin Server is not available.
* Similar to with Admin Server but use nmStart instead of Start WLST command.

Example Setup

* See this post for an example NM setup.

No comments:

Post a Comment

xslt padding with characters call template for left pad and right pad

  Could a call-template be written that took two parameters ?   a string, and a   number) return the string with empty spaces appended t...