A quick tutorial for middleware products

Saturday, November 22, 2014

On November 22, 2014 by Kamlesh   No comments

Basic concepts of WLST.

What is WLST?
It is a scripting tool offered by Weblogic.
Any way WLST is not only for a sense of control, it’s very powerful and handy for troubleshooting, doing same thing repeatedly.
IBM’s Websphere –> wsadmin
Oracle Weblogic –> WLST
Please don’t get intimated by name. It’s very simple tool.  Few commands are there which are used mostly. We will discuss them.
We can use WLST in two modes
1. Online mode
–Online means, when we use WLST to connect to Admin or Managed servers which are ACTIVE, online.
— Here, we can do all the domain configuration management activity that we can do from Admin console
— we can change the domain configuration
2. Offline mode
— Offline means, when we are not connected to any ACTIVE server.
— Here we can create domain, create domain template, extend domain.
— We can connect to Node Manager and start/stop Managed servers or in fact Admin server also.
Note: Without Node manager, we cannot start/stop Managed servers through WLST.
— Can’t view performance data in offline mode.
Why is it important to know about Online/Offline mode?
Because we should know what we can do and what we cannot. It’s very simple.
When you know about WLST commands, Just remember this
Node manager helps to start/stop servers. WLST acts as an interface to Node manager in offline mode.

So, How do we start (invoke) WLST?
wlst.sh/wlst.cmd is the script which starts WLST. We will use below.
(In Linux)
$ . .$DOMAIN_HOME/bin/SetDomainEnv.sh   <——–  To set the environment.
$ . .$MW_HOME/wlserver_10.3/common/bin/wlst.sh <— MW_HOME is Middleware home
(In Window)
c:/DOMAIN_HOME/bin/SetDomainEnv.cmd   <——–  To set the environment.
C:/MW_HOME/wlserver_10.3/common/bin/wlst.cmd <— MW_HOME is Middleware home

<WL_HOME>/common/bin/wlst.cmd myscript.py
Example: C:/Oracle/Middleware/wlserver_10.3/common/bin/wlst.cmd myscript.py

Initializing Weblogic Scripting Tool (WLST) …
Welcome to Weblogic server Administration Scripting Shell
Type help() for help on available commands
wls:/offline>
As you sees, by default, it connects in offline mode. To issue any online command, first we need to “connect” to some ACTIVE server instance.
syntax –> wls:/offline>connect (‘username’,’password’,’url:port’)
wls:/offline>connect (‘weblogic’,’weblogic1′,’t3://testserver.com:7001′)
Successfully connected to Admin Server ‘Testadmin’ that belongs to domain ‘testdomain’
wls:/testdomain/serverconfig>
To disconnect from a server
wls:/testdomain/serverconfig>disconnect ()
To exist from WLST
wls:/testdomain/serverconfig>exit ()

We can invoke WLST by using following command also
$ $DOMAIN_HOME/java weblogic.WLST
Initializing Weblogic Scripting Tool (WLST) …
Welcome to Weblogic server Administration Scripting Shell
Type help() for help on available commands
wls:/offline>

0 comments:

Post a Comment