an introduction to weblogic server console and wlst

16
www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 1 An Introduction To WebLogic Administration 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. History: Version Description Change Author Publish Date 0.1 Initial Draft Kuldeep Mishra 12th Aug 2012 0.1 Review#1 Amit Sharma 18 th Aug 2012

Upload: amit-sharma

Post on 30-Oct-2014

33 views

Category:

Documents


6 download

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 WebLogicAdministration. The document focuses on detailed information about WebLogic Admin Consoleand Scripting tool. Join our professional training program and learn from experts.

TRANSCRIPT

Page 1: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 1

An Introduction To

WebLogic Administration 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.

History: Version Description Change Author Publish Date

0.1 Initial Draft Kuldeep Mishra 12th Aug 2012 0.1 Review#1 Amit Sharma 18th Aug 2012

Page 2: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 2

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

Page 3: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 3

An Introduction to WebLogic Server Administration Console

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.

Page 4: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 4

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)

Page 5: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 5

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

Elements of the Administration Consol

The Administration Console user interface includes the following panels Change Center :

It is using to make changes in WebLogic Server Administration Console .

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.

Page 6: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 6

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 previously-

visited 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.

Using the Change Center

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:

Page 7: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 7

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.

How Change Management Works To provide a secure, predictable means for distributing configuration changes in a domain,

WebLogic Server imposes a change management process that loosely resembles a database transaction. The configuration of a domain is represented on the file system by a set of XML

configuration files, centralized in the config.xml file, and at runtime by a hierarchy of Configuration MBeans. When we edit the domain configuration, we edit a separate hierarchy of Configuration MBeans that resides on the Administration Server. To start the edit process,

we obtain a lock on the edit hierarchy to prevent other people from making changes. When we finish making changes, we save the changes to the edit hierarchy. The changes do not

take effect, however, until we activate them, distributing them to all server instances in the

Page 8: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 8

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.

Deploying Multiple Applications

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.

Page 9: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 9

WebLogic Scripting Tool The WebLogic Scripting Tool (WLST) is a command-line scripting interface that system

administrators and operators use to monitor and manage WebLogic Server instances and domains. The WLST scripting environment is based on the Java scripting interpreter, Jython. In addition to WebLogic scripting functions, we can use common features of interpreted

languages, including local variables, conditional variables, and flow control statements. WebLogic Server developers and administrators can extend the WebLogic scripting language

to suit their environmental needs by following the Jython language syntax

Using Jython

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

Page 10: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 10

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 server’s in- memory 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 domain’s 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 line—Interactive Mode ii)In batches, supplied in a file—Script 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

Page 11: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 11

Steps for Using WLST in Interactive or Script Mode

Setting Up Your Environment :

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 top- level 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.

ii))Here we see the message Your environment has been set.

Page 12: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 12

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')

Page 13: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 13

v) In command prompt write cd('Servers') and then write ls() command to show the directory.

vi) In command prompt write cd('ManagedServer_1') to changes to the directory.

Page 14: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 14

vii) In command prompt write get('StartupMode') to checks the value of the StartupMode

attribute for the server “ManagedServer_1”

viii) In command prompt write exit().

Page 15: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 15

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.

Page 16: An Introduction to WebLogic Server Console and WLST

www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 16