Showing posts with label Node Manager. Show all posts
Showing posts with label Node Manager. Show all posts

Thursday, 16 July 2015

Node Manager Configure, Start and Stop Step by Step


General Node Manager Configuration: (Step by Step)


Start Admin Server:

C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\bin>startWebLogic.cmd

.... Login Weblogic Admin Console


.... Click on Environments -> Machines


.... Click on New tab right side


.... Enter name of Machine and select Machine OS as Unix (Unix Machines)  Other wise By Default Other


Click Next

Node Manager Properties
Type -- Plain
Listen Address -- localhost
Listen Port -- 5556


Click Finish

To Check Status

Start Node Manager

Linux ---- $WL_HOME\server\bin\startNodeManager.sh
Windows ------ C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin>startNodeManager.cmd

Admin Console --- Environment ---- Machines ---- Machine2 ---- Monitering ---- NodeManagerStatus



Stop Node Manager

Linux --- kill -9 `ps -ef | grep -i nodemanager.javahome | grep -v grep | awk {'print $2'} | head -1`

On windows close the cmd prompt(NodeManagerStarted window)

Node Manager Log Files:

C:\Oracle\Middleware\Oracle_Home\oracle_common\common\nodemanager\nodemanager.properties - used by java based node manager. This file is created on first time start of Node Manager(startNodeManager.cmd)

C:\Oracle\Middleware\Oracle_Home\oracle_common\common\nodemanager\nodemanager.domains - contains mappings between the names of domains managed by Node Manager and their corresponding directories

like
base_domain= C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain

C:\Oracle\Middleware\Oracle_Home\oracle_common\common\nodemanager\nm_data.properties - This file store the encryption data the Node Manager uses as asymmetric encryption key. This file is created on first time start of nodemanager (startNodeManager.cmd)

C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\config\nodemanager - This file stores the Node Manager username and password used by Admin Server to connect to Node Manager.

Few other configuration files are boot.properties, startup.properties,server_name.addr, server_name.lck, server_name.pid, server_name.state







Node Manager



How Node Manager Works in the WebLogic Server Environment:

Node Manager in the WebLogic Server Environment:



How Node Manager Starts an Administration Server:





This section assumes that you have installed the Administration Server and created its domain directory using the Configuration Wizard.


Node Manager is running on Machine A, which hosts the Administration Server. The stand-alone Node Manager client is remote.

1.An authorized user issues the WLST offline command, nmConnect to connect to the Node Manager process on the machine that hosts the Administration Server, and issues a command to start the Administration Server. (If the Node Manager instance is the SSH version, the user can connect using the SSH client).
The start command identifies the domain and server instance to start, and in the case of the Java Node Manager, provides the Node Manager username and password.
Note:
If the user has previously connected to the Node Manager, a boot.properties file exists, and the user does not have to supply username and password.

2. Node Manager looks up the domain directory in nodemanager.domains, and authenticates the user credentials using a local file that contains the encrypted username and password.
3. Node Manager creates the Administration Server process.
4. The Administration Server obtains the domain configuration from its config directory.

How Node Manager Starts a Managed Server:





1. From the Administration Console, the user issues a start command for Managed Server 1.
   Note:
        A stand-alone client can also issue a start command for a Managed Server.

2. The Administration Server issues a start command for Managed Server 1 to the Node Manager on        the Machine B, providing the remote start properties configured for Managed Server 1. For                  information about the arguments and how to specify them.

3. Node Manager starts Managed Server 1.
   Node Manager starts the Managed Server using the same root directory where the Node Manager        process is running. To run the Managed Server in a different directory, set the Root Directory              attribute in the Server—>Configuration—>Server Start console page.

4. Managed Server 1 contacts the Administration Server to check for updates to its configuration             information.

5. If there are outstanding changes to the domain configuration, Managed Server 1 updates its local cache of configuration data.


How Node Manager Restarts an Administration Server 

Node Manager is running on the machine that hosts the Administration Server. The Administration Server, which was initially started with Node Manager, has exited. The Administration Server’s AutoRestart attribute is set to true.

Note: If a server instance’s AutoRestart attribute is set to false, Node Manager will not restart it.



1. Node Manager determine from the Administration Server process exit code that it requires restart.

2. Node Manager obtains the username and password for starting the Administration Server from the boot.properties file, and the server startup properties from the
<server_name>/data/nodemanager/startup.properties file.

3. Node Manager starts the Administration Server.

4. The Administration Server reads its configuration data and starts up.

How Node Manager Restarts a Managed Server:

Node Manager is running on Machine B, which hosts Managed Server 1, which was initially started with Node Manager, has existed. Managed Server 1's AutoRestart attribute is set to true

Note: If a server instance's AutoRestart attribute is set false, Node Manager will not restart it.



1. Node Manager determines from Managed Server 1’s last known state that it requires restarting.

2. Node Manager obtains the username and password for starting Managed Server 1 from the                   boot.properties file, and the server startup properties from the startup.properties file. These server-      specific files are located in the server directory for Managed Server 1.

3. Node Manager starts Managed Server 1.
Note: Node Manager waits RestartDelaySeconds after a server instances fails before attempting       to restart it.

4. Managed Server 1 attempts to contact the Administration Server to check for updates to its                 configuration data. If it contacts the Administration Server and obtains updated configuration data,     it updates its local cache of the config directory.

5. If Managed Server 1 fails to contact the Administration Server, and if Managed Server                         Independence mode (MSI) is enabled, Managed Server 1 uses its locally cached configuration             data.
Note: Managed Server Independence mode is enabled by default.

How Node Manager Shutdown a Server Instance:

The Communications involved in shutting down a Managed Server that is under Node Manger Control. Depending on the state and availability of the Managed Server, Node Manager might need to try alternative strategies to successful initiate the shutdown.

Node Manager is running on Machine B, which hosts Managed Server 1.



1. Through the Administration Console, an authorized user issues a shutdown command for Managed      Server 1.

2. The Administration Server issues the shutdown command directly to Managed Server 1. If it               successfully contacts Managed Server 1, Managed Server 1 performs the shutdown sequence               described in “Graceful Shutdown” in Managing Server Startup and Shutdown.

3. If, in the previous step, the Administration Server failed to contact Managed Server 1, it issues a         shutdown command for Managed Server 1 to Node Manager on Machine B.

4. Node Manager issues a request to the operating system to kill Managed Server 1.

5. The operating system ends the Managed Server 1 process.



Node Manager Configuration

Node Manager Configuration:

Java Based Node Manager:

It is recommended that you configure Node Manager to run as an operating system service or a Windows service on Windows systems.

By default, the operating system service starts up Node Manager to listen on localhost:5556.

When you configure Node Manager to accept commands from remote systems,you must uninstall the default Node Manager Service, then reinstall it to listen on a non-localhost listen address.

Depending on your platform,follow the instructions in Reconfigure Startup Service for Windows Installations or Configuring Java-based Node Manager Security.

Reconfigure Startup Service for Windows Installations

The directory WL_HOME\server\bin contains uninstallNodeMgrSvc.cmd, a script for uninstalling the Node Manager service, and installNodeMgrSvc.cmd, a script for installing Node Manager as a service.

1. Delete the service using uninstallNodeMgrSvc.cmd
2. Edit installNodeMgrSvc.cmd to specify Node Manager's Listen Address and Listen Port.

  Make the same edits to uninstallNodeMgrSvc.cmd as you make to installNodeMgrSvc.cmd, so that you can successfully uninstall the service in the future, as desired.
3. Run installNodeMgrSvc.cmd to re-install Node Manager as a service, listening on the updated address and port.

Configuring Java-based Node Manager Security:

Node Manager security relies on a one-way SSL connection between the client and server.

If you are establishing a command line connection to the Java Node Manager using the WebLogic Server Scripting Tool (WLST) nmConnect command, you provide the Node Manager user name and password. Node Manager verifies the username and password against the domain's nm_password.properties file.

Node Manager credentials are located on the Security>General>Advanced Options Console page.

Administration Console users do not need to explicitly provide credentials to connect to Node Manager—the Node Manager user name and password are available in the domain configuration and are provided automatically.

Configuring Node Manager to Use Start and Stop Scripts

You can configure Node Manager to use a script to start a managed server or to execute a script after server shutdown has completed. These scripts can be used to perform tasks that need to be peformed before a server is started or after it is shutdown. Mounting and unmounting remote disks is one example of a task that can be performed using scripts.



Note:

Node Manager uses startup scripts to perform any required configration, then start the server. In contrast, stop scripts are executed after the server has shutdown.


Using Start Scripts 

You can use a start script allows you to specify required startup properties and perform any other work you need performed at start up. To define a start script:

1. In the nodemanager.properties file, set the StartScriptEnabled property to true. (The default is false.) If your start script is named startWebLogic.sh or startWebLogic.cmd, Node Manager uses one of those scripts as the default.
2. If you want to specify a custom start script, set the StartScriptName property to the name of your script in the nodemanager.properties file

Using Stop Scripts 

You can use a stop script to perform any tasks that are required after the server has shutdown. To define a stop script:

1. In the nodemanager.properties file, set the StopScriptEnabled property to true.
2. Set the StopScriptName property to the name of your script in the nodemanager.properties file.

The following example shows a stop script that can be used to unmout a disk on UNIX systems:

#!/bin/sh
FS=/cluster/d2
if grep $FS /etc/mnttab > /dev/null 2>&1 ; then
sync
              PIDS=`/usr/local/bin/lsof $FS | awk
             '{if ($2 ~/[0-9]+/) { print $2} }' | sort -u`
kill -9 $PIDS
sleep 1
sync
/usr/sbin/umount -f $FS
fi

Configuring Script-based Node Manager :

The SSH Node Manager is a shell script, wlscontrol.sh, located in {WL_HOME}/common/bin/. wlscontrol.sh must exist on each machine that hosts server instances that you want to control with Node Manager. This script can be customized to meet site-specific requirements.

You must have an SSH client executable on each machine where Node Manager or a Node Manager client runs. This script must also be in the path of the user id running it. Typically, an SSH client is a standard part of a Unix or Linux installation.

 Overriding the Default SSH Port

The default SSH port used by Node Manager is 22. You can override that setting in the following ways:

 . Set the Port= parameter in the ~/.ssh/config file to set the default port for an individual user.
 . Set the Port= parameter in the /etc/ssh_config file to set the default port across the entire system.
 . Start the Administration Server using the following system property:

-Dweblogic.nodemanager.ShellCommand="ssh -o PasswordAuthentication=no -p %P %H wlscontrol.sh -d %D -r %R -s %S %C"
 After starting the server, you can edit the SSH port in the Administration Server’s configuration file.

Configuring Script-based Node Manager Security 

The Node Manager SSH shell script relies on SSH user-based security to provide a secure trust relationship between users on different machines. Authentication is not required. You create a UNIX user account—typically one per domain—for running Node Manager commands and scripts. A user logged in as this user can issue Node Manager commands without providing a username and password.



Note:

You must also ensure that the Node Manager and WebLogic Server commands are available in the path of the UNIX user ID used to run them.

Remote Server Start Security for Script-based Node Manager 

A remote start user name and password is required to start a server instance with Node Manager. These credentials are provided differently for Administration Servers and Managed Servers.

 . Credentials for Managed Servers—When you invoke Node Manager to start a Managed Server it obtains its remote start name and password from the Administration Server.
 . Credentials for Administration Servers—When you invoke Node Manager to start an Administration Server, the remote start user name can be provided on the command line, or obtained from the Administration Server’s boot.properties file. The Configuration Wizard initializes the boot.properties file and the startup.properties file for an Administration Server when you create the domain.

Any server instance started by Node Manager encrypts and saves the credentials with which it started in a server-specific boot.properties file, for use in automatic restarts.

Generating and Distributing Key Value Pairs :

The script-based Node Manager uses two types of key value pairs. This section contains instructions for distributing key value pairs to the machines that will host a Node Manager client or server.

Shared Key Value Pair 

This option distributes the same key value pair to all machines that will host a Node Manager client or server.

The simplest way to accomplish this is to set up your LAN to mount the Node Manager user home directory on each of the machines. This makes the key value pair available to the machines. Otherwise

1. Generate an RSA key value pair for the user with the ssh-keygen command provided with your SSH installation.

The default location for the private and public keys are ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub respectively.

If these keys are stored in a different location, modify the ShellCommand template, adding an option to the ssh command to specify the location of the keys.
 2. Append the public key to the ~/.ssh/authorized_keys file on the Node Manager machine. For example:

command="/home/bea/server90/common/nodemanager/nodemanager.sh" 1024 33 23...2323

in which the you substitute the public key that you generated, as stored in id_rsa.pub, for the string shown in the example as

1024 33 23...2323



Note:

The prefix command=<command> ensures that a user that establishes a session with the machine using the public key can only run the command specified—nodemanager.sh. This ensures that the user can only perform Node Manager functions, and prevents unauthorized access to data, system utilities, or other resources on the machine.

3. Manually distribute the key value pair to each machine that will host a Node Manager server instance or client.
4. Execute the following command on the client machine to check that the Node Manager client can access the Node Manager:

/home/bea$ ssh montgomery VERSION

This response indicates that the client accessed Node Manager successfully:

+OK NodeManager v9.1.0

Individual Key Value Pairs

On each machine that will host a Node Manager client: 

1. Generate a separate RSA key value pair for the Node Manager user as described in step one in the previous section.

2. Append the public key to the machine's ~/.ssh/authorized_keys file user as described in step two in the previous section.