It is based on the Java scripting interpreter, Jython.
In addition to supporting standard Jython features such as local variables, conditional variables, and flow control statements, WLST provides a set of scripting functions (commands) that are specific to WebLogic Server.
You can use WLST as the command-line equivalent to the WebLogic Server Administration Console (WLST online) or as the command-line equivalent to the Configuration Wizard (WLST offline)
Online
You can use WLST to connect to a running Administration Server and manage the configuration of an active domain, view performance data about resources in the domain, or manage security data (such as
adding or removing users).
Offline
Without connecting to a running WebLogic Server instance, you can use WLST to create domain templates, create a new domain based on existing templates, or extend an existing, inactive domain. You cannot use WLST offline to view performance data about resources in a domain or modify security data (such as adding or removing users).
MODES
Interactive Mode
Script Mode
Embedded Mode
In embedded mode, you instantiate the WLST interpreter in your Java code and use it to run WLST commands and scripts
Setting Up Your Environment
Run setDomainEnv.sh under <Domain>/bin directory.
Invoking WLST
To use WLST in interactive mode:
java weblogic.WLST
To connect to a WebLogic Server instance after you start WLST in interactive mode:
wls:/offline> connect('weblogic','weblogic','localhost:7001')
To use WLST in script mode:java weblogic.WLST c:\myscripts\myscript.py
wls:/mydomain/serverConfig> exit()
Exiting WebLogic Scripting Tool ...
c:\>
Syntax for WLST Commands
- Command names and arguments are case sensitive.
- Enclose arguments in single or double quotes. For example,
'newServer'
or "newServer"
. - If you specify a backslash character (
\
) in a string, either precede the backslash with another backslash or precede the entire string with a lower-case r
character. The \ or r
prevents Jython from interpreting the backslash as a special character. readTemplate('c:\\userdomains\\mytemplates\\mytemplate.jar')
or readTemplate(r'c:\userdomains\mytemplates\mytemplate.jar')
- When using WLST offline, the following characters are not valid in names of management objects: period (
.
), forward slash (/
), or backward slash (\
). If you need to cd
to a management object whose name includes a forward slash (/
), surround the object name in parentheses. For example:cd('JMSQueue/(jms/REGISTRATION_MDB_QUEUE)')
Start Node Manager if Node Manager is not already running, you can log on to the host computer and use WLST to start it: Connect WLST to a Node Manager by entering the nmConnect command. nmConnect('weblogic', 'weblogic', 'localhost', '5556', 'mydomain','c:/bea/user_projects/domains/mydomain','ssl') Use the nmStart command to start a server. wls:/nm/mydomain>nmStart('AdminServer') starting server AdminServer ... Server AdminServer started successfully wls:/nm/mydomain> Monitor the status of the Administration Server by entering the nmServerStatus command. Stop the server by entering the nmKill command. wls:/nm/mydomain>nmKill('serverName') Killing server AdminServer Server AdminServer killed successfully wls:/nm/mydomain>To start a Managed Server, enter the following command: where managedServerName is the name of the server. For example,
start('managed1','Server') start('clusterName', 'Cluster') For example:start('mycluster', 'Cluster')
Mukesh, thanks for sharing the valuable information- Naren
ReplyDeleteMy pleasure.
Delete