Friday, 13 April 2018

How to start/stop Node manager and Managed server in Weblogic

How to start/stop Node manager and Managed server in Weblogic

We will be discussing Node manager and manage server start/stop in this article.

Node Manager

The Node Manager is the WebLogic Server utility to control the life cycle—start, stop, restart of the WebLogic Managed Server instances and the Administration Server.

It should be available on each and every node in a distributed Weblogic env

Suppose you have created a domain TEST_DOMAIN consisting of two server test01 and test02. Then node manager should be activated on both the nodes

How to start the Node manager


1. Log in as the oracle user on the machine test01 where the weblogic server is installed and set the below environment variable

JAVA_HOME=/u00/app/oracle/jdk1.70_21

export JAVA_HOME

MW_HOME=/u00/app/oracle/weblogic

export MW_HOME

WL_HOME=/u00/app/oracle/weblogic/wlserver_10.3

export WL_HOME

DOMAIN_NAME=/u00/app/oracle/weblogic/user_projects/domain/test_domain

export DOMIAN name


2) Navigate to below folder

$ cd $WL_HOME/server/bin

3. Start the Node Manager in the background. Since it’s the first time you are starting it, the $WL_HOME/common/nodemanager/nodemanager.properties file will be created.

$ nohup ./startNodeManager.sh &

[1] 6962

nohup: appending output to `nohup.out’

3. Do the same on the test02 machine and on all the machines of the WebLogic domain.

How Node manager works

1) You can leave the default values created for nodemanager.properties.

The Node Manager has started and is listening to port 5556. The value is the number of the newly created process.

2) The node manager running on the server test01 and test02 should be reachable and able to receive start and stop commands from the Administration Console.

How to shutdown the Node Manager


There is no formal command to shut down the Node Manager, so you’ll have to do it manually, killing the process:

1. Find the value of the Node Manager process:
$ ps aux | grep weblogic.NodeManager | grep -vgrep | awk ‘{print $2} ‘

2. Issue a kill command to PID to finish it:
$ kill

Starting/Stopping the WebLogic Managed Server

Suppose you have created the Managed server in your weblogic domain as part of configuration,Now how to start them

There are two possible way to execute it

1) With the help of Node manager
2) Without the help of Node manager

I will be explaining in detail about both these options

With the help of Node manager

1) For this option,Node manager should be running on each weblogic node. Read the above section on how to configure and start it up

2) Now Access the Administration Console with your web browser at

Navigate to the Settings for Domain page by clicking on Home and then Domain or by clicking the TEST_DOMAIN link.

3) Click on the Control tab.

4) Select the checkbox to the left of the WebLogic Server name -> click on the Start button to start the servers or the Shutdown button to shutdown. The Shutdown button has two options: When work completes or Force Shutdown Now. Select Force Shutdown Now.

5) Confirm the operation by clicking on the Yes button on the Server Life Cycle Assistant page.

How it works

When a start/stop operation is invoked for Managed Server, the Administration Console issues this command to the Node Manager. The Node Manager receives the startup

parameters and credentials from the Administration Console and starts the Managed Server. The Managed Server then contacts the Administration Server and checks for configuration changes and if necessary, updates it. If the Administration Server is not reachable, the Managed Server uses the local copy of the configuration from the $DOMAIN_HOME/config/* directory.

The Managed Server can also be started and stopped using WLST with the Node Manager

Here are the steps to start

1) Log in as the oracle user on the machine test01 where the weblogic server is installed and set the below environment variable

JAVA_HOME=/u00/app/oracle/jdk1.70_21

export JAVA_HOME

MW_HOME=/u00/app/oracle/weblogic

export MW_HOME

WL_HOME=/u00/app/oracle/weblogic/wlserver_10.3

export WL_HOME

DOMAIN_NAME=/u00/app/oracle/weblogic/user_projects/domain/test_domain

export DOMIAN name


2) Now start WLST

$WL_HOME/common/bin/wlst.sh

3) . Connect to the Administration Server using wlsadmin as the user, as the password, and t3:// as the server URL:

wls:/offline>connect(“weblogic”,”password”,”t3://ip:port”)

4) Run the following WLST command to start mang_test01( Manage server)

start(‘mang_test01′,’Server’)

The above command will start the manage server

Now similarly we can stop the manage server

To stop the Managed Server, type the following command:

shutdown(‘mang_test01′,’Server’)

The WLST method works the same way as the Administration Console. The Administration Console and WLST are both clients accessing the Node Manager, and both invoke start/stop operations on it.

Without the help of Node manager

1) You can use the startManagedWebLogic.sh and stopManagedWebLogic.sh script located at the $DOMAIN_HOME/bin directory:

2) Log in as the oracle user on the machine test01 where the weblogic server is installed and set the below environment variable

JAVA_HOME=/u00/app/oracle/jdk1.70_21

export JAVA_HOME

MW_HOME=/u00/app/oracle/weblogic

export MW_HOME

WL_HOME=/u00/app/oracle/weblogic/wlserver_10.3

export WL_HOME


DOMAIN_NAME=/u00/app/oracle/weblogic/user_projects/domain/test_domain


Go to the WebLogic domain’s bin directory:

$ cd $DOMAIN_HOME/bin


3) Start the Managed Server mang_test01 typing:

$ ./startManagedWebLogic.sh mang_test01 t3://ip:port

The server will initiate the startup process and ask for a WebLogic administrator username and password:
Enter username to boot WebLogic server: weblogic
Enter password to boot WebLogic server
:

4. Type weblogic as the username and you previously specified at the domain creation as the password.

5. The WebLogic Managed Server will start.

6. To stop the mang_test01 Managed Server, provide the credentials
weblogic/:

$ ./stopManagedWebLogic.sh mang_test01 t3://

Note
Scripts usage
startManagedWebLogic.sh
stopManagedWebLogic.sh
stopManagedWebLogic.sh
How to avoid entering the weblogic username and password and start it in background

1. Go to the Managed Server root folder:

$ cd $DOMAIN_HOME/servers/security/
2. Create a new file called boot.properties with weblogic as the username and the
value you specified:

$ echo -ne “username=weblogic\npassword=
” > boot.properties

$ cat boot.properties

username=weblogic

password=


The next time you start WebLogic Managed, it will use the credentials

from the boot.properties file. The file will also be encrypted:

cat boot.properties

password={PES}I0giDJGR0FATHnfPsoZvpmF/Ipc\=

username={PES}PsS/IccG3VgZv6LP1zj+Ro1JBDb2ZE\=


3) start the weblogic server in background

nohup ./startManagedWebLogic.sh &
[1] 7585

The 7585 value is the process ID of the Managed . The standard output (stdout) and standard error (stderr) of the process will be appendedv to a file called $DOMAIN_HOME/bin/nohup.out.

WebLogic Managed Server will look for the credentials provided in the boot.properties file under $DOMAIN_HOME/servers//security/ when starting from the script.

No comments:

Post a Comment

All about WebLogic t3 and t3s Protocol

WebLogic's  implementation of the RMI specification uses a proprietary protocol known as T3. You can think of T3 (and secure T3S) as a l...