Saturday, December 22, 2018

Working with WLST with Node Manager

Commands:

nmConnect : Connect to Node Manager
nmServerStatus: Print Server status of connected domain.
nmStart: Start Weblogic Server( Admin or Managed Servers)
nmKill: Stop Weblogic Server


Common Errors & Exampls:
=>Error: Could not find or load main class weblogic.WLST
Reason : Error means that the correct CLASSPATH has not been set
The setWLSEnv.sh script needs to be sourced in order to execute the script in the context of the running shell, and have the actual environment of the shell be set. It has to be executed as either “. ./setWLSEnv.sh” (notice the extra dot) or “source ./setWLSEnv.sh” and then the CLASSPATH can be confirmed in the current shell with the “env” command.

Simply executing the script “./setWLSEnv.sh” will only display the output on the screen.

The alternative is to run directly the specific wlst.sh of the Oracle product that is installed. This will automatically set the correct environment for that product.

The script is located under $ORACLE_HOME/common/bin/wlst.sh

=>Connect NodeManager from WLST Tools
nmConnect([username, password], [host], [port], [domainName], [domainDir], [nmType])
nmConnect([userConfigFile, userKeyFile], [host], [port], [domainName], [domainDir], [nmType])

Example : nmConnect
wls:/offline> nmConnect('nodemanager','nodemanager123','localhost','5556','base_domain','/home/skubuntu/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain','plain')
Connecting to Node Manager ...
Successfully Connected to Node Manager.
wls:/nm/base_domain>

Example : nmServerStatus
wls:/nm/base_domain> nmServerStatus('node1')
RUNNING
wls:/nm/base_domain>

Example : nmStart
wls:/nm/base_domain> nmStart('node1')
Starting server node1 ...
Successfully started server node1 ...

wls:/nm/base_domain>


Example : nmKill
wls:/nm/base_domain> nmKill('node1')
Killing server node1 ...
Successfully killed server node1
wls:/nm/base_domain> 

Import Links:
http://www.dba-oracle.com/t_weblogic_wlst_server_start.htm
Books : Advanced WebLogic Server Automation

No comments:

Post a Comment