Wednesday, May 29, 2013

Start WebLogic Servers by Node Manager in WLST

Version: WebLogic 10.3.5
Description:  The WebLogic Scripting Tool (WLST) can be utilized to establish a connection to Node Manager. Within the Node Manager session in WLST, you can execute out-of-the-box WLST commands to start the managed servers or the admininstrator server.

Step 1: Start Node Manager by running the "startNodeManager.sh" script located in "<wl_home>/server/bin" directory.
cd /home/oracle/Oracle/Middleware/wlserver_10.3/server/bin
./startNodeManager.sh
ps -ef | grep nodemanager #Determines if nodemanager is running

Step 2: Execute "wlst.sh" located in "<WL_HOME>/common/bin" directory.
cd /home/oracle/Oracle/Middleware/wlserver_10.3/common/bin
./wlst.sh

Step 3: When you execute the wlst.sh, you'll be in the WLST command interface as indicated by "wls:/offline>". Run the following command:
nmConnect([username, password], [host], [port], [domainName], [domainDir], [nmType], [verbose])
username='weblogic';
password='Password1';
host='localhost';
port='5556';
domainName='oim_domain';
domainDir='/home/oracle/Oracle/Middleware/user_projects/domains/oim_domain';
nmType='ssl';
verbose='false';
nmConnect(username,password,host,port,domainName,domainDir,nmType,verbose);

Step 4: Once you've connected to Node Manager as indicated by "wls:/nm/oim_domain>", start the severs by executing the following commands:
nmStart('AdminServer');
nmStart('oim_server1');

Other Helpful Commands:
nmKill('oim_server1'); #Stops a server that is controlled by Node Manager
nmDisconnect(); #End Node Manager session in WLST
nmServerStatus('oim_server1'); #Checks server status ran by Node Manager
exit(); #Exit out of WLST command interface
startNodeManager(); #Start the Node Manager on local machine
stopNodeManager(); #Stops the Node Manager on local machine 

Troubleshooting
You may run into this error if you try running the WLST script to start OIM managed server and assuming this is your first time starting OIM managed server.

There are 1 nested errors:

weblogic.management.ManagementException: Booting as admin server, but servername, oim_server1, does not match the admin server name, AdminServer
    at weblogic.management.provider.internal.RuntimeAccessService.start(RuntimeAccessService.java:67)
    at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesManager.java:461)
    at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServicesManager.java:166)
    at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:881)
    at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:568)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:469)
    at weblogic.Server.main(Server.java:71) 

The cause for this is the boot.properties and the startup.properties are not present. You can fix this by starting OIM by running or running nmGenBootStartupProps() WLST command. These options should create the necessary files.

No comments:

Post a Comment