Wednesday, 11 January 2012

WebLogic 11g: Setup Node Manage


* See this post for a Node Manager overview.

* See this post on how to install WebLogic and SOA Suite.

Setup Machine

Create a Machine if None Exists

* Start Admin Server with startup script.
* Login Admin Console.
* Create a new Machine type if one does not exist.
- Go to: soa_domain > Environment > Machines

Assign Machine to Managed Server

* Assign managed servers to be managed by NM to newly created machine.
- Click soa_domain > Environment > Servers > Configuration tab.
- Click on the managed server to be added to new machine.
- Assign Machine property.

Assign Machine to Admin Server

* Stop Admin Server with script.
* Go to domain config directory.
cd /opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain/config
* Backup config.xml
cp config.xml config.xml.082211
* Assign AdminServer to machine by adding <machine>LocalMachine</machine> immediately beblow the AdminServer name element:
* Start AdminServer with script.
* Check that AdminServer has been successfully assigned to machine.

Set Server Specific Startup Parameters

* If you have set StartScriptEnabled to true in (see below), then the class path and JVM arguments from the script will be used first and the values you specified on the Server Startup page second.
* You can override server specific startup parameters on the Environment > Servers > my_server > Configuration > Server Start page.

* Note: use -Xnohup instead of -Xrs if you use JRockit JVM.

Setup NM


* Go to /opt/oracle/Middleware/home_11gr1/wlserver_10.3/common/nodemanager directory.
cd /opt/oracle/Middleware/home_11gr1/wlserver_10.3/common/nodemanager
* Edit and set the following properties to true:

Start NM

# start NM
cd /opt/oracle/Middleware/home_11gr1/wlserver_10.3/server/bin

Invoke WLST and Connect to NM

# Start WLST
cd /opt/oracle/Middleware/home_11gr1/wlserver_10.3/common/bin
# Connect to NM
nmConnect('weblogic', 'welcome1', 'localhost', '5556', 'soa_domain', '/opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain','ssl')

Enroll Domain into Node Manager

# Connect to Admin Server:
# Enroll domain:
nmEnroll('/opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain', '/opt/oracle/Middleware/home_11gr1/wlserver_10.3/common/nodemanager')

Setup Startup Script

Set Debug Flag to False

* In dev mode, the debug flag defaults to true in the startup script. It will cause error 202: bind failed: Address already in use error when you try to start managed servers.
cd /opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain/bin
export debugFlag

Start Servers via NM

Start Admin Server via NM

* Stop Admin Server with script.
* Start Admin Server with NM:
# Connect to NM
nmConnect('weblogic', 'welcome1', 'localhost', '5556', 'soa_domain', '/opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain','ssl')
# Start AdminServer
# Show Admin Server status

Start Managed Server via NM

# Connect to Admin Server
# Start Managed Server

Test Crash Recovery

* Find pid for managed server.
cd /opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain/servers/soa_server1/data/nodemanager
cat cat
# We got
# Check process and we got one process
ps -ef|grep 21786
* Kill process manually.
# Kill process
kill -9 21786
# Recheck process and it should be gone
* Check auto start.
# Check and we got a new process id
* Login Admin Console and you should see soa_server1 is in the state of STARTING or RUNNING.


error 202: bind failed: Address already in use

* This happened when I tried to start managed server from NM.
* It's due to servers were started in debug mode and the debug port is already in use by Admin Server when it got started.
* See this post for more discussions.
* Fix: set debugFlag to false in file.
cd /opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain/bin
export debugFlag

No comments:

Post a Comment