Using Administration Console and WLST

<< Previous

Use the Administration Console to:

* Configure, start, and stop WebLogic Server instances
* Configure WebLogic Server clusters
* Configure WebLogic Server services, such as database connectivity (JDBC) and messaging (JMS)
* Configure security parameters, including managing users, groups, and roles
* Configure and deploy your applications
* Monitor server and application performance
* View server and domain log files
* View application deployment descriptors
* Edit selected run-time application deployment descriptor elements

Access the WebLogic Server administration console

* http://hostname:port/console, e.g http://localhost:7001/console
* https://hostname:port/console, e.g https://localhost:7002/console

Describe the parts of the administration console

* Change Center
* Domain Structure: contains a tree structure you can use to navigate to pages in the Administration Console.
* How do I…: links to online help tasks that are relevant to the current Console page.
* Tool Bar:
– Welcome message: Indicates user name with which you have logged into the Console.
– Connected to: The IP address and port you used to connect to the Console.
– Home: A link to the top page of the Console.
– Log Out: Click to log out of the Console.
– Preferences: A link to a page where you can change some Console behavior.
– Record: Starts recording your configuration actions as a series of WebLogic Scripting Tool (WLST) commands. Writes the commands to a separate file that you can replay in WLST.
– Help: A link to the Administration Console Online Help.
– Search: A text field in which you can enter a string to find any WebLogic Server Configuration MBeans that contain the string you specified in their name.
* Breadcrumb Navigation: A series of links that show the path you have taken through the Administration Console’s pages. You can click on any of the links to return to a previously-visited page.
* System Status: The System Status panel reports on the number of information, error, and warning messages that have been logged. You can view these messages in the server log files, which you can access from the Administration Console at Diagnostics > Log Files.

Describe the parts of the help system

* Two parts:
– How do I…: documents procedures for tasks you can perform through using the Console.
– Administration Console Reference: provides reference information for each page in the Console, including descriptions of the attributes you can set using the Console.

Access admin console preferences

* Tool Bar > Preferences

Make a change to the configuration (lock & edit, make change, view changes and restarts (optional), activate changes)

* Locate the Change Center in the upper left of the Administration Console screen.
* Click the Lock & Edit button to lock the configuration edit hierarchy for the domain.
* Make the changes you desire on the relevant page of the Console. Click Save on each page where you make a change.
* Changes are saved in DOMAIN_HOME/pending/config.xml file
* When you have finished making all the desired changes,
– click Activate Changes in the Change Center for changes to take effect.
– click Undo All Changes to revert any pending changes.

Dynamic and Non-Dynamic Changes

* Non-dynamic changes require that the affected servers or system resources be restarted before they become effective.
* Non-dynamic properties are marked with an exclamation mark:

* Dynamic changes do not require server restart
* All changes are applied as a unit. So a single non-dynamic change requires restart in order for other dynamic changes to take effect.

Viewing Changes

You can view any changes that you have saved, but not yet activated, by clicking the View Changes and Restarts link in the Change Center. The View Changes and Restarts link presents two tabs, Change List and Restart Checklist:
* The Change List page presents all changes that have been saved, but not yet activated.
* The Restart Checklist lists all servers for which non-dynamic changes have been activated, but which require restarts before the changes become effective.

Run a WSLT script

Jython

* Java implementation of Python scripting language
* Can use both Java and Python standard libraries.
* Jython codes can be compiled to Java byte code (.class) and distributed in .jar files.
* Jython can be used
– interactively
– in batch
– embedded within Java class

WLST

* Used for:
– automating common admin activities
– an alternative to admin console
– when graphical tools are not supported
* Usage example:
– creating new WLS domains
– retrieving and updating WLS domain configurations
– deploying applications
– get run time server stats

WLST Modes

* Online mode
– connected to a running server
– access to all WLS config and run time attributes
– create and activate change sessions similar to WLS console
* Offline mode
– domain not running
– access only to persisted domain config data, i.e. config.xml
– create or update domains similar to using Configuration Wizard

Interactive Mode

* Invoke WLST method 1:

cd $WL_HOME/common/bin
./wlst.sh

* Invoke WLST method 2:

cd $WL_HOME/server/bin
. ./setWLSEnv.sh
java weblogic.WLST
 
# Use SSL connection
java -Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.TrustKeyStore=DemoTrust weblogic.WLST

* Example

wls:/offline> connect('weblogic','welcome1','t3://wlbox:7001')
Connecting to t3://wlbox:7001 with userid weblogic ...
Successfully connected to Admin Server 'examplesServer' that belongs to domain 'wl_server'.
 
Warning: An insecure protocol was used to connect to the 
server. To ensure on-the-wire security, the SSL port or 
Admin port should be used instead.
 
wls:/wl_server/serverConfig> cd('Servers')
wls:/wl_server/serverConfig/Servers> ls()
dr--   examplesServer
 
wls:/wl_server/serverConfig/Servers> cd('examplesServer')
wls:/wl_server/serverConfig/Servers/examplesServer> get('StartupMode')
'RUNNING'
wls:/wl_server/serverConfig/Servers/examplesServer> exit()
 
Exiting WebLogic Scripting Tool.

Run Script

cd $WL_HOME/server/bin
. ./setWLSEnv.sh
 
java weblogic.WLST -i my_wlst_script.py # -i prevent WLST from exiting
 
# or
cd $WL_HOME/common/bin
./wlst.sh
 
wls:/(offline)>execFile('my_wlst_script.py')

Describe common WLST commands

General WLST Commands

* See WLST information commands

help()
help('connect')
exit()
dumpVariables()
dumpStack()
redirect('./logs/wlst.log')
stopRedirect()

Offline WLST Commands

createDomain
readDomain
updateDomain
writeDomain
 
readTemplate
addTemplate
writeTemplate
 
assign/unassign
setOption
 
configToScript

Online WLST Commands

connect
disconnect
 
start
shutdown
 
startEdit
stopEdit
activate
showChanges
isRestartRequired
 
deploy
redeploy
undeploy

WebLogic JMX MBeans

* Hierarchical Java objects found on the server
* Have attributes and operations
* Supports configuration, management, and monitoring of all types of server resources
* Like Unix file system, use cd, ls, pwd to navigate the server config or run time MBeans
* Use get/set to read/update MBean attributes
* cmo variable refers to current MBean (cmo: current mbean object)
* See here for more variables

Record

* Example: create data source named test

cd('/')
cmo.createJDBCSystemResource('test')
 
cd('/JDBCSystemResources/test/JDBCResource/test')
cmo.setName('test')
 
cd('/JDBCSystemResources/test/JDBCResource/test/JDBCDataSourceParams/test')
set('JNDINames',jarray.array([String('test')], String))
 
cd('/JDBCSystemResources/test/JDBCResource/test/JDBCDriverParams/test')
cmo.setUrl('jdbc:oracle:thin:@wlbox:1521:xe')
cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
setEncrypted('Password', 'Password_1342368349274', '/labs/wls1035/wlserver_10.3/samples/domains/wl_server/Script1342368096529Config', '/labs/wls1035/wlserver_10.3/samples/domains/wl_server/Script1342368096529Secret')
 
cd('/JDBCSystemResources/test/JDBCResource/test/JDBCConnectionPoolParams/test')
cmo.setTestTableName('SQL SELECT 1 FROM DUAL\r\n\r\n')
 
cd('/JDBCSystemResources/test/JDBCResource/test/JDBCDriverParams/test/Properties/test')
cmo.createProperty('user')
 
cd('/JDBCSystemResources/test/JDBCResource/test/JDBCDriverParams/test/Properties/test/Properties/user')
cmo.setValue('dbuser')
 
cd('/JDBCSystemResources/test/JDBCResource/test/JDBCDataSourceParams/test')
cmo.setGlobalTransactionsProtocol('TwoPhaseCommit')
 
cd('/SystemResources/test')
set('Targets',jarray.array([ObjectName('com.bea:Name=examplesServer,Type=Server')], ObjectName))
 
activate()

>> Next

[mv_include id=’3268′]

* Overview of the Administration Console
* Middleware Magic WLST post.

This entry was posted in certification, weblogic11g and tagged , , , . Bookmark the permalink.

One Response to Using Administration Console and WLST

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.