An Introduction To WebLogic Server Console and WLST
An Introduction To WebLogic Server Console and WLST
Description: BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Guide for WebLogic Administration. The document focuses on detailed information about WebLogic Admin Console and Scripting tool. Join our professional training program and learn from experts.
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 1
Contents
An Introduction to WebLogic Server Administration Console ...................................................................................................... 3 Use the Administration Console to:............................................................................................................................... 3 Starting the Administration Console ............................................................................................................................ 3 Administration Console Login ......................................................................................................................................... 3 Disabling and Enabling Admin Console .......................................................................................................................... 4 From Admin console:- ............................................................................................................................................................... 4 From WLST:- .............................................................................................................................................................................. 4 Enabling the Admin Console: .................................................................................................................................................... 5 Elements of the Administration Consol ........................................................................................................................................ 5 Change Center ........................................................................................................................................................................... 5 Domain Structure: ..................................................................................................................................................................... 5 System Status: ........................................................................................................................................................................... 6 Using the Change Center........................................................................................................................................................... 6 Undoing Changes ...................................................................................................................................................................... 7 Releasing the Configuration Lock .............................................................................................................................................. 7 How Change Management Works ................................................................................................................................................ 7 Dynamic and Non-Dynamic Changes ........................................................................................................................................ 8 Viewing Changes ....................................................................................................................................................................... 8 Deploying Multiple Applications ............................................................................................................................................... 8 WebLogic Scripting Tool ................................................................................................................................................................ 9 Using Jython .............................................................................................................................................................................. 9 What Does WLST Do? ................................................................................................................................................................ 9 Using WLST Online or Offline ............................................................................................................................................. 9 Using WLST Online ............................................................................................................................................................. 9 Interactive Mode, Script Mode, and Embedded Mode ............................................................................................... 10 Interactive Mode ................................................................................................................................................................ 10 Script Mode ......................................................................................................................................................................... 10 Steps for Using WLST in Interactive or Script Mode.................................................................................................. 11 Setting Up Your Environment :................................................................................................................................................ 11
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 2
The WebLogic Server Administration Console is a Web browser-based, graphical user interface that we use to manage a WebLogic Server domain. A WebLogic Server domain is a logically related group of WebLogic Server resources that we manage as a unit. A domain includes one or more WebLogic Servers and may also include WebLogic Server clusters. Clusters are groups of WebLogic Servers instances that work together to provide scalability and high-availability for applications. We deploy and manage our applications as part of a domain. 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 our applications -Monitor server and application performance -View server and domain log files -View application deployment descriptors -Edit selected runtime application deployment descriptor elements -Control (start, stop, and restart) standalone Coherence cache servers -Create and configure Coherence clusters Starting the Administration Console To start the Administration Console: i) Start an Administration Server. ii) Open one of the supported Web browsers to the following URL: iii) http://hostname:port/console Where hostname is the DNS name or IP address of the Administration Server and port is the listen port on which the Administration Server is listening for requests (port 7001 by default). If we have configured a domain-wide administration port, use that port number. If we configured the Administration Server to use Secure Socket Layer (SSL) we must add s after http as follows: https://hostname:port/console Administration Console Login When the login page appears, enter the user name and the password we used to start the Administration Server (we may have specified this user name and password during the installation process) or enter a user name that belongs to one of the following security groups: Administrators, Operators, Deplorers, or Monitors. These groups provide various levels of access to system administration functions in the Administration Console. Using the security system, we can add or delete users to one of these groups to provide controlled access to the Console. Enter the username and password that we set when creating our domain.
www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 3
Disabling and Enabling Admin Console By default, the Administration Console is enabled. If we disable it, we can re-enable it using the WebLogic Scripting Tool (WLST). Start the Administration Server, then invoke WLST and use the following commands: Disabling our Admin Console: We can disable our weblogic admin console in two different ways i) Admin console ii) Weblogic Scripting Tool From Admin console:To disable access to the Administration Console: 1. After we log in to admin console click Lock & Edit. 2. In the left pane of the Console, under Domain Structure, select the domain name. 3. Select Configuration > General, and click Advanced at the bottom of the page. 4. Deselect Console Enabled. 5. Click Save. 6. To activate these changes, click Activate Changes. From WLST:connect(weblogic,weblogic,t3://localhost:7001) edit() startEdit() cmo.setConsoleEnabled(false)
www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 4
save() activate() disconnect() exit() Enabling the Admin Console: After we disable the admin console we can enable it again by using WLST. Following are the steps on the same: connect(weblogic,weblogic,t3://localhost:7001) edit() startEdit() cmo.setConsoleEnabled(true) save() activate() disconnect() exit() Note: Here, i. weblogic and weblogic are the user id and password of admin console. ii. t3://localhost:7001 is the admin console URL iii. After we enable/disable the admin console RESTART our admin server
Domain Structure:
Contains a tree structure we can use to navigate to pages in the Administration Console. Click a + (plus) icon in the Domain Structure to expand a node and a - (minus) icon to collapse the node.
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 5
It give links to online help tasks that are relevant to the current Console page.
Breadcrumb Navigation: A series of links that show the path we have taken through the Administration Console's pages. We can click on any of the links to return to a previouslyvisited page. System Status: The System Status panel reports on the number of information, error, and warning messages that have been logged. We can view these messages in the server log files, which we can access from the Administration Console at Diagnostics > Log Files.
The starting point for using the Administration Console to make changes in our WebLogic Server domain is the Change Center. To make any changes using the console, we must:
www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 6
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. This enables us to make changes using the Administration Console. Make the changes we desire on the relevant page of the console. Click Save on each page where we make a change. When we have finished making all the desired changes, click Activate Changes in the Change Center.
Undoing Changes
We can revert any pending (saved, but not yet activated) changes by clicking Undo All Changes in the Change Center. We can revert any individual change by going to the appropriate page in the Administration Console and restoring the attribute to its previous value.
Releasing the Configuration Lock
We release the configuration lock as follows: i) Before we make changes, click Release Configuration in the Change Center to release the lock explicitly. ii) After we save changes, click Activate Changes or Undo All Changes in the Change Center to release the lock implicitly. Stopping the Administration Server does not release the configuration lock. When the Administration Server starts again, the configuration lock is in the same state it was in when the Administration Server was shut down, and any pending changes are preserved.
domain. When we activate changes, each server determines whether it can accept the change. If all servers are able to accept the change, they update their working configuration hierarchy and the change is completed.
Dynamic and Non-Dynamic Changes
i)Non-dynamic changes require that the affected servers or system resources be restarted before they become effective. ii)Non-dynamic properties are marked with an exclamation mark:
iii) Dynamic changes do not require server restart iv) 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
We can view any changes that we 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: i) The Change List page presents all changes that have been saved, but not yet activated. ii) The Restart Checklist lists all servers for which non-dynamic changes have been activated, but which require restarts before the changes become effective.
When we use the Administration Console to deploy multiple applications, upon installing the applications, they are listed in the Console's Deployments page in the "distribute Initializing" state. After activating changes, they are listed in the "Prepared" state. To deploy the applications, select the application names on the Deployments page and click Start.
www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 8
i) Java implementation of Python scripting language ii) Can use both Java and Python standard libraries. iii) 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
What Does WLST Do?
WLST lets we perform the following tasks: i) Propagate a WebLogic Server domain to multiple destinations using predefined configuration and extension templates. ii) Retrieve domain configuration and runtime information iii) Edit the domain configuration and persist the changes in the domain's configuration files. iv) Edit custom, user-created MBeans and non-WebLogic Server MBeans, such as WebLogicIntegration Server and WebLogic Portal Server MBeans. v) Automate domain configuration tasks and application deployment. vi) Control and manage the server life cycle. vii) Access the Node Manager and start, stop, and suspend server instances remotely or locally, without requiring the presence of a running Administration Server. We can create, configure, and manage domains using WLST, command-line utilities, and the Administration Console interchangeably. The method that you choose depends on whether we prefer using a graphical or command-line interface, and whether we can automate our tasks by using a script Using WLST Online or Offline We 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) Using WLST Online We 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
www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 9
manage security data (such as adding or removing users). We can also use WLST to connect to Managed Servers, but we cannot modify configuration data from Managed Servers. WLST online is a Java Management Extensions (JMX) client. It interacts with a servers inmemory collection of Managed Beans (MBeans), which are Java objects that provide a management interface for an underlying resource Using WLST Offline Without connecting to a running WebLogic Server instance, we can use WLST to create domain templates, create a new domain based on existing templates, or extend an existing, inactive domain. We cannot use WLST offline to view performance data about resources in a domain or modify security data (such as adding or removing users). WLST offline provides read and write access to the configuration data that is persisted in the domains config directory or in a domain template JAR created using Template Builder Interactive Mode, Script Mode, and Embedded Mode We can use any of the following techniques to invoke WLST commands: i)Interactively, on the command lineInteractive Mode ii)In batches, supplied in a fileScript Mode iii)Embedded in Java code Embedded Mode Interactive Mode Interactive mode, in which we enter a command and view the response at a command-line prompt, is useful for learning the tool, prototyping command syntax, and verifying configuration options before building a script. Using WLST interactively is particularly useful for getting immediate feedback after making a critical configuration change. The WLST scripting maintains a persistent connection with an instance of WebLogic Server. WLST can write all of the commands that we enter during a WLST session to a file. We can edit this file and run it as a WLST script. Script Mode Scripts invoke a sequence of WLST commands without requiring our input, much like a shell script. Scripts contain WLST commands in a text file with a .py file extension, for example, filename.py. We use script files with the Jython commands for running scripts. Using WLST scripts, we can: i) Automate WebLogic Server configuration and application deployment ii) Apply the same configuration settings, iteratively, across multiple nodes of a topology iii) Take advantage of scripting language features, such as loops, flow control constructs, conditional statements, and variable evaluations that are limited in interactive mode iv) Schedule scripts to run at various times v) Automate repetitive tasks and complex procedures vi) Configure an application in a hands-free data center
www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 10
To set up your environment for WLST: 1) Install and configure the WebLogic Server software. 2) Add WebLogic Server classes to the CLASSPATH environment variable and WL_HOME\server\bin to the PATH environment variable, where WL_HOME refers to the toplevel installation directory for WebLogic Server. We can use a WL_HOME\server\bin\setWLSEnv script to set both variables. On Windows, a shortcut on the Start menu sets the environment variables and invokes WLST (Tools WebLogic Scripting Tool). i)Write the command setWLSEnv.cmd to set environment.
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 11
iii)In command prompt write java weblogic.WLST to Initializing Weblogic Scripting Tool.
iv)Here we see the message Initializing Weblogic Scripting Tool(WLST). To go to connect server in offline mode write the command connect('weblogic','admin123','t3://localhost:7001')
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 12
v) In command prompt write cd('Servers') and then write ls() command to show the directory.
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 13
vii) In command prompt write get('StartupMode') to checks the value of the StartupMode attribute for the server ManagedServer_1
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 14
Exiting WLST
To exit WLST, enter the exit() command: wls:/mydomain/serverConfig> exit() Exiting WebLogic Scripting Tool ... c:\> After write exit() command in command prompt, We see the Exiting Weblogic Scripting Tool message.
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 15
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 16