0% found this document useful (0 votes)
17 views

03 Config Slides

Uploaded by

shamsher3052
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

03 Config Slides

Uploaded by

shamsher3052
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

Module 3

Configuring a WebLogic Server


Environment
At the end of this module you will be able to:
9 Configure domains, machines, and managed servers
9 Start the WebLogic Server Administration Console
9 Start managed servers at boot time
9 Set Basic properties using the Administration Console
9 Perform basic Administration from the Command Line
9 Administer servers and managed servers

Configuring a WebLogic Server Environment-1 © 2006 BEA Systems, Inc. 67


Road Map

1. Configuring Domains
– How WebLogic Server Domain works
– Domain Directory Structure and Files
– Creating a Domain
2. Configuring Servers
3. Domain Templates
4. Console Administration
5. Command Line Administration

Configuring a WebLogic Server Environment-2 © 2006 BEA Systems, Inc. 68


Domain Overview
Domain Cluster
Domain Log
Get Configuration
at Startup Managed
LOG Server 1

Critical Domain LOG Local Logging


Notifications
Domain Log
Messages Managed
Console Administration
Server 2
Server
LOG Local Logging
GET / SET

Managed
Monitor/
Server 3
Update
Configuration LOG Local Logging
Repository
Configuring a WebLogic Server Environment-3 © 2006 BEA Systems, Inc. 69
Configuring a Domain

f After installing, configure a WLS domain on which to


develop and deploy applications.
f When you create a domain, you define a collection of
resources, such as:
– Managed servers
– Clusters
– Database connections
– Security services
– J2EE applications
f Use the Configuration Wizard to create and configure
WLS domains.

Configuring a WebLogic Server Environment-4 © 2006 BEA Systems, Inc. 70


Starting Configuration Wizard

f Scripts in <WEBLOGIC_HOME>/common/bin directory


f Graphical mode
– Windows Start menu
– [Windows] config.cmd
– [Unix/Linux] config.sh
f Console mode
– [Windows] config.cmd –mode=console
– [Unix/Linux] config.sh –mode=console
f Note: silent mode is deprecated in WebLogic Server 9.X

Configuring a WebLogic Server Environment-5 © 2006 BEA Systems, Inc. 71


Configuration Wizard – Graphical Mode

f The graphical version of the domain configuration


wizard walks the user through each step.

Configuring a WebLogic Server Environment-6 © 2006 BEA Systems, Inc. 72


Domain Directory Structure
Directory Column Head
 domain-name The name of this directory is the name of the domain.
 autodeploy In development mode, WLS automatically deploys any applications
or modules that you place in this directory.
 bin The scripts for starting and stopping the Administration Server and
the Managed Servers in the domain.
 config The current configuration and deployment state of the domain.
config.xml.
 console-ext Console extensions.
 init-info Server initialization information.
 lib JAR files added to the classpath of each server instance.
 pending Domain configuration changes that have been requested, but not
yet activated.
 security Domain-wide security-related files.
 server One subdirectory for each server in the domain.
 server-name The server directory for the WLS instance with the same name.

Configuring a WebLogic Server Environment-7 © 2006 BEA Systems, Inc. 73


Section Review

In this section we discussed:


9 How a WebLogic Server domain works
9 The domain directory structure
9 Domain files
9 How to create a domain

Configuring a WebLogic Server Environment-8 © 2006 BEA Systems, Inc. 74


Road Map

1. Configuring Domains
2. Configuring Servers
– Configuring Managed Servers
– Starting Managed Servers
– Running Multiple WLS Instances
3. Domain Templates
4. Console Administration
5. Command Line Administration

Configuring a WebLogic Server Environment-9 © 2006 BEA Systems, Inc. 75


Configuring Managed Servers

1 2

Configuring a WebLogic Server Environment-10 © 2006 BEA Systems, Inc. 76


Starting Managed Servers
Domain
Domain Log Get configuration Cluster
at startup (http/https)

LOG ServerA
192.168.1.2:7001
Critical Domain
Get configuration LOG Local Logging
Notifications
at startup (http/https)
Admin Server
192.168.1.1:7001 ServerB
192.168.1.1:7002 192.168.1.3:7001
GET / SET LOG Local Logging

Get configuration Proxy


at startup (http/https) 192.168.1.4:7001
Configuration
LOG Local Logging
Repository
Configuring a WebLogic Server Environment-11 © 2006 BEA Systems, Inc. 77
Starting Managed Servers

f To start a managed server you must:


– Specify a server name
– Specify an administration server URL from which to load
configuration information

To start a managed server:


java -server –Xms256m –Xmx512m
1 -Dweblogic.Name=%SERVER_NAME% -Dplatform.home=C:\bea\weblogic91
-Dweblogic.management.username=%WLS_USER%
-Dweblogic.management.password=%WLS_PW%
2 -Dweblogic.management.server=%ADMIN_URL%
-Dweblogic.ProductionModeEnabled=%STARTMODE%
-Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy
weblogic.Server
10
0101
<startManagedWeblogic.cmd> 1110

Configuring a WebLogic Server Environment-12 © 2006 BEA Systems, Inc. 78


Creating a Boot Identity File

f Create a file called boot.properties located in


the domain’s root directory containing 2 lines:
– username=username
– password=password

f First time you start the server, the server reads the Boot
Identity file and overwrites it with an encrypted version
of the username and password.
f Thereafter, the server will remember your identity for
the subsequent startup cycles.

Configuring a WebLogic Server Environment-13 © 2006 BEA Systems, Inc. 79


Managed Server Independence…

f By default, managed servers can function


independently of the administration server.
f Configure Managed Server Independence Mode from
the Console:

Configuring a WebLogic Server Environment-14 © 2006 BEA Systems, Inc. 80


…Managed Server Independence

f If the administration server is unavailable at boot time,


managed servers search for:
– config.xml
– SerializedSystemIni.dat
– boot.properties(optional)

f Each managed server looks in its local config directory


for config.xml - a replica of the domain’s
config.xml

Configuring a WebLogic Server Environment-15 © 2006 BEA Systems, Inc. 81


What If an Admin Server Is Down?

f The administration server:


– Can go down without affecting the operation of managed
servers
– Can be restarted while managed servers are still running
f When an administration server goes down:
– Domain log entries are lost while it is down
– Managed servers can start in independent mode
– The administration console and management tools are
unavailable

Configuring a WebLogic Server Environment-16 © 2006 BEA Systems, Inc. 82


Administration Server Backup

f WLS allows the creation of a backup of the server as


follows:
– Install (if necessary) WLS on backup machine
– Copy application files to backup machine
– Copy configuration files to backup machine
– Restart Administration server on new machine
f The new Administration server will contact managed
servers and inform them that it is running on a new IP
address.

Configuring a WebLogic Server Environment-17 © 2006 BEA Systems, Inc. 83


Running Multiple WLS Instances

f You can run multiple instances of WLS using different


configurations on the same physical machine at the
same time by:
– Assigning multiple IP address to a machine (multihoming)
and defining each server to use a unique IP address
f or by:
– Specifying the same IP address but using different listen
ports

Configuring a WebLogic Server Environment-18 © 2006 BEA Systems, Inc. 84


Multihoming

f A multihomed machine:
– Is a machine with multiple IP addresses
– Can run a different WLS instance bound to each IP address
– Can be used to configure a cluster on a single machine

192.168.1.1

192.168.1.2
Machine

Configuring a WebLogic Server Environment-19 © 2006 BEA Systems, Inc. 85


Section Review

In this section we discussed:


9 How to define and start an administration server
9 How to create and start a managed server
9 Managed server
independence
9 Administration server
backup

Configuring a WebLogic Server Environment-20 © 2006 BEA Systems, Inc. 86


Road Map

1. Configuring Domains
2. Configuring Servers
3. Domain Templates
– Creating customized domain templates
4. Console Administration
5. Command Line Administration

Configuring a WebLogic Server Environment-21 © 2006 BEA Systems, Inc. 87


Custom Domain Templates

f A domain template defines the full set of resources


within a domain.
f Although BEA provides templates for creating any
platform domain, you may wish to create your own or
customize an existing template.
f The Domain Template Builder lets
you define templates:
– Define a domain and replicate it across multiple projects
– Distribute a domain packed with an application that has been
developed to run in it

Configuring a WebLogic Server Environment-22 © 2006 BEA Systems, Inc. 88


Creating a Domain Template

To create a domain template:


1. Create a new template using Domain Template Builder
2. Select Configuration Template Source
3. Describe the template.
4. Add files to the Template.
5. Add SQL Scripts to the Template
6. Configure the Administration Server, Username and Password.
7. Specify Start Menu entries.
8. Review Domain Template
9. Create Template

Configuring a WebLogic Server Environment-23 © 2006 BEA Systems, Inc. 89


Starting Domain Template Builder

f Using the GUI mode in Windows environment or


f Using script config_builder.cmd or sh
config_builder.sh under \common\bin
directory

Configuring a WebLogic Server Environment-24 © 2006 BEA Systems, Inc. 90


Create a New Template

Configuring a WebLogic Server Environment-25 © 2006 BEA Systems, Inc. 91


Select Configuration Template Source

Configuring a WebLogic Server Environment-26 © 2006 BEA Systems, Inc. 92


Describe the Template

Configuring a WebLogic Server Environment-27 © 2006 BEA Systems, Inc. 93


Add Files to the Template

Add
script
to
domain

Configuring a WebLogic Server Environment-28 © 2006 BEA Systems, Inc. 94


Add SQL Files to the Template

Configuring a WebLogic Server Environment-29 © 2006 BEA Systems, Inc. 95


Configure the Administration Server

Configuring a WebLogic Server Environment-30 © 2006 BEA Systems, Inc. 96


Configure Administrator Username
and Password

Configuring a WebLogic Server Environment-31 © 2006 BEA Systems, Inc. 97


Specify Start Menu Entries

Configuring a WebLogic Server Environment-32 © 2006 BEA Systems, Inc. 98


Review Domain Template

Configuring a WebLogic Server Environment-33 © 2006 BEA Systems, Inc. 99


Create Template

Configuring a WebLogic Server Environment-34 © 2006 BEA Systems, Inc. 100


Domain Template Created

Configuring a WebLogic Server Environment-35 © 2006 BEA Systems, Inc. 101


Section Review

In this section, we learned how to:


9 Understand the benefits of using a custom domain
template
9 Create a custom domain template

Configuring a WebLogic Server Environment-36 © 2006 BEA Systems, Inc. 102


Exercise

Create a Domain Template


f For details on the exercise, refer to the Lab Guide.
f If questions arise, ask the instructor.
f The instructor will determine the stop time.

Configuring a WebLogic Server Environment-37 © 2006 BEA Systems, Inc. 103


Road Map

1. Configuring Domains
2. Configuring Servers
3. Domain Templates
4. Console Administration
– WebLogic Server Administration Console
– Setting Basic Properties Via Console
5. Command Line Administration

Configuring a WebLogic Server Environment-38 © 2006 BEA Systems, Inc. 104


Administration Using the Console

f Using the Administration Console you can:


– Configure attributes of resources
– Deploy applications or components
– Configure, collect and view diagnostic information
– Start and shutdown servers, or perform other management
actions

Configuring a WebLogic Server Environment-39 © 2006 BEA Systems, Inc. 105


Starting the Console

f After starting the administration server, you can start


the console in the browser of your choice:

Starting the Administration Console:


http://hostname:port/console (unsecure)

https://hostname:secureport/console (secure)

hostname := name or IP address of the administration server


port := port number the administration server is listening on
secureport := SSL port number the administration server is listening on

Example URLs:
http://localhost:7001/console
http://adminDNSName:7001/console
https://127.0.0.1:7002/console
10
0101
1110

Configuring a WebLogic Server Environment-40 © 2006 BEA Systems, Inc. 106


Console Login

f Enter the user name and password that you set when
creating your domain.

Configuring a WebLogic Server Environment-41 © 2006 BEA Systems, Inc. 107


Using the Administration Console

Configuring a WebLogic Server Environment-42 © 2006 BEA Systems, Inc. 108


Using the Administration Console…

Configuring a WebLogic Server Environment-43 © 2006 BEA Systems, Inc. 109


Setting Basic Properties

f Changing Stdout severity threshold:

Configuring a WebLogic Server Environment-44 © 2006 BEA Systems, Inc. 110


Shutting Down a Server

Configuring a WebLogic Server Environment-45 © 2006 BEA Systems, Inc. 111


Advanced Options in Console

f The Weblogic Server Administration Console hides


options which are not frequently used
f To display the Advanced Options section, click the
“Advanced” link.

f If you do not want to see the Advanced Options on


the console display, click the “Advanced” link one
more time.

Configuring a WebLogic Server Environment-46 © 2006 BEA Systems, Inc. 112


XML Schema for config.xml

f The config.xml file adheres to an XML schema


that can be used for validation
f config.xml aggregates configuration information
from other configuration files representing WLS
subsystems, which adhere to their own XML schemas
f config.xml is now located (by default) in the
user_projects/domains/domain_name/con
fig folder
f Subsidiary configuration files are located in subfolders

Configuring a WebLogic Server Environment-47 © 2006 BEA Systems, Inc. 113


Configuration Directory Structure
Directory Column Head
 config The current domain configuration and deployment
state (config.xml).
 configCache Cached configuration information.
 deployments The staging area for staged applications.
 diagnostics System modules for instrumentation in the WebLogic
Diagnostic Service.
 jdbc System modules for JDBC.
 jms System modules for JMS.
 lib Jar files added to the system classpath of the server.
 nodemanager Node Manager configuration information.
 security System modules for the security framework.
 startup System modules that contain startup plans. Startup
plans are used to generate shell scripts that can be
used as part of server startup.

Configuring a WebLogic Server Environment-48 © 2006 BEA Systems, Inc. 114


Predictable Distribution of Domain
Configuration Changes

f Change management features of WLS enables you to


distribute configuration changes throughout a domain
securely, consistently, and predictably.
f Change management behavior is the same, regardless
of whether you are using:
– The WLS Administration Console
– The new WebLogic Scripting Tool
– JMX
f To use change management, use the Change Center
region in the WLS Administration Console.

Configuring a WebLogic Server Environment-49 © 2006 BEA Systems, Inc. 115


The Configuration Change Process
f WLS configuration change management process loosely
resembles a database transaction.
f The domain configuration is represented two ways:
– On the file system by a set of XML configuration files, centralized in the
config.xml file
– At run time by a hierarchy of Configuration MBeans
f When you edit the domain configuration, you edit a separate
hierarchy of Configuration MBeans that resides on the
administration server.
f When you activate changes, it’s a 2-phase commit (2PC)
process:
– 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.

Configuring a WebLogic Server Environment-50 © 2006 BEA Systems, Inc. 116


Configuration Management
Architecture

Administration Server Managed Server

JMX Server JMX Server JMX Server

edit read read

File-based distribution
using Administration
Config.xml channel Config.xml

Edit works
on separate • Simple beans (not remote)
copy of files • File-based change distribution
• Separation of edit and activation

Configuring a WebLogic Server Environment-51 © 2006 BEA Systems, Inc. 117


Section Review

In this section we discussed:


9 How to start the Administration Console
9 Setting basic properties
using the console

Configuring a WebLogic Server Environment-52 © 2006 BEA Systems, Inc. 118


Exercise

Using the Administration Console


f In this lab you will configure and stop WLS using the
Console.
f Ask the instructor for any clarification.
f The instructor will
determine the stop time.

Lab Exercise

Configuring a WebLogic Server Environment-53 © 2006 BEA Systems, Inc. 119


Road Map

1. Configuring Domains
2. Configuring Servers
3. Domain Templates
4. Console Administration
5. Command Line Administration
– Managing WebLogic Server Via the Command Line WLST
tool

Configuring a WebLogic Server Environment-54 © 2006 BEA Systems, Inc. 120


The WebLogic Scripting Tool (WLST)

f Command-line tools are useful:


– For automating administration using scripts
– As an alternative to the Administration Console
f WLST provides a command-line interface that:
– Configures WLS instances and domains
– Manages and persists WLS configuration changes

Configuring a WebLogic Server Environment-55 © 2006 BEA Systems, Inc. 121


WLST

f WLST enables you to:


– Retrieve domain configuration and runtime information
– Edit the domain configuration and persist the changes in
config.xml
– Navigate and edit custom, user-created management beans (MBeans)
and non-WLS MBeans such as WebLogic Integration Server and
WebLogic Portal Server MBeans
– Automate configuration tasks and application deployment
(repeatability)
– Clone WebLogic Server domains
– Access Node Manager and start, stop, and suspend server instances
remotely or locally, without requiring the presence of a running
Administration Server

Configuring a WebLogic Server Environment-56 © 2006 BEA Systems, Inc. 122


Built on Jython

f Jython advantages include:


– 100% pure Java implementation of Python
– Simple & clear syntax
– Proven to be fast and reliable
– Highly extensible (create your own commands, use any
existing Java classes)
f WLST interprets commands in two ways:
– Interactively, supplied one-at-a-time from a command
prompt
– In batch supplied in a file (script), or embedded in your Java
code

Configuring a WebLogic Server Environment-57 © 2006 BEA Systems, Inc. 123


Main Steps for using WLST

f Setting environment
f Invoking WLST
f Requirement for entering WLST commands
f Running Scripts
f Importing WLST as a Jython Module
f Exiting WLST

Configuring a WebLogic Server Environment-58 © 2006 BEA Systems, Inc. 124


Setting Environment

f Install and configure the WebLogic Server software


f Add WebLogic Server classes to the CLASSPATH
environment variable
f Add WL_HOME\server\bin to the PATH environment
variable

Configuring a WebLogic Server Environment-59 © 2006 BEA Systems, Inc. 125


Invoking WLST

f Connecting to WLS through SSL listen port


– java -
Dweblogic.security.SSL.ignoreHostnameVerification=true -
Dweblogic.security.TrustKeyStore=DemoTrust
weblogic.WLST
f Not connecting to WLS through the SSL listen port
– java weblogic.WLST
– A welcome message and WLST prompt appears:
wls:/(offline)>
– To use WLST online:
connect('username','password','t3s://localhost:7012')
– To shut down a server, for example:
shutdown('myserver','Server','false',1000)
– To exit WLST:
exit()

Configuring a WebLogic Server Environment-60 © 2006 BEA Systems, Inc. 126


Requirement for Entering WLST
commands
f Case sensitive names and arguments of commands
f Arguments enclosed in single or double quotes
f Precede the quoted string by r while specifying backslash (\) in a
string
– Example: readTemplate(r'c:\mytemplate.jar')
f Invalid characters in object names while using WLST offline:
– Period (.)
– Forward slash (/)
– Backward slash (\)
f Cannot access security information through WLST while
updating a domain
f Display help
– Example: wls:/mydomain/serverConfig> help(‘disconnect’)

Configuring a WebLogic Server Environment-61 © 2006 BEA Systems, Inc. 127


Running Scripts

f WLST incorporates two Jython functions that support


running scripts:
– java weblogic.WLST filePath.py, which invokes WLST and
executes a script file in a single command,
– execfile(“filePath.py”) which executes a script file after you
invoke WLST.

Configuring a WebLogic Server Environment-62 © 2006 BEA Systems, Inc. 128


Import WLST as a Jython Module

1) Invoke WLST:
c:\>java weblogic.WLST
wls:/offline>
2) Use the writeIniFile command to convert WLST definitions
and method declarations to a .py file:
wls:/offline> writeIniFile("wl.py")
3) Open a new command shell and invoke Jython directly by
entering the following command:
c:\>java org.python.util.jython
4) Import the WLST module into your Jython module using
the Jython import command:
>>>import wl
5) Now you can use WLST methods in the module. For
example, to connect WLST to a server instance:
wl.connect(’username’,’password’)

Configuring a WebLogic Server Environment-63 © 2006 BEA Systems, Inc. 129


Exiting WLST

Exit WLST:
wls:/mydomain/serverConfig> exit()
Exiting WebLogic Scripting Tool ...
c:\>

Configuring a WebLogic Server Environment-64 © 2006 BEA Systems, Inc. 130


Online and Offline Modes

f Online (connected to a running server):


– WLST provides simplified access to MBeans.
– You can perform administrative tasks and initiate WLS
configuration changes while connected to a running server.
f Offline (not connected to a running server):
– WLST limits access to only persisted configuration
information.
– You can create a new domain or update an existing domain
without connecting to a running WLS—this functionality
resembles that of the Configuration Wizard.

Configuring a WebLogic Server Environment-65 © 2006 BEA Systems, Inc. 131


Modes of Operation

f Interactive
– When you enter a command in the WLST console and view
the response immediately
f Script
– When you create a text file, with .py extension, that contains
a series of WLST commands
f Embedded
– When you instantiate an instance of the WLST interpreter in
your Java code and use it to run WLST commands

Configuring a WebLogic Server Environment-66 © 2006 BEA Systems, Inc. 132


Simplified Command-Line Access

f WLST includes the capabilities of:


– weblogic.Admin (deprecated in 9.X)
– weblogic.Deployer
– wlconfig Ant tasks
– Configuration wizard (silent mode, deprecated in 9.X)
f It allows you to navigate the WLS MBean tree like a file system.
f To access WLST:
– In a non-secure environment use: java weblogic.WLST
– In a secure environment use:
java -Dweblogic.security.SSL.ignoreHostnameVerification=true
-Dweblogic.security.TrustKeyStore=DemoTrust weblogic.WLST

Configuring a WebLogic Server Environment-67 © 2006 BEA Systems, Inc. 133


WLST Example

Configuring a WebLogic Server Environment-68 © 2006 BEA Systems, Inc. 134


Some WLST Commands…

Command Description Syntax

connect(‘weblogic’,
connect Connects to a server ’weblogic’,
instance (online mode) ’t3://localhost:7011’)

disconnect Disconnects from a server disconnect()


instance (online mode)

exit Exits WLST (online mode) exit()

readDomain Opens an existing domain readDomain(’c:/bea/user_pro


for updating (offline mode) jects/domains/onlinestore’)
Updates and saves the
updateDomain current domain (offline updateDomain()
mode)

Configuring a WebLogic Server Environment-69 © 2006 BEA Systems, Inc. 135


…Some WLST Commands

Command Description Syntax


Start a managed server instance start('mycluster',
start
or a cluster (online mode) 'Cluster')
Suspends a running server suspend(‘mainserver’)
suspend
(online mode)
Gracefully shuts down a WLS
shutdown(‘myCluster’,
shutdown instance or a cluster (online ’Cluster’)
mode)
startServer(‘adminserver’,
Starts the administration server ’humanresources’,
startServer
(offline mode) ’t3://localhost:7011’)
Resumes a server that is in the resume(‘mainserver’)
resume
ADMIN state (online mode)

Configuring a WebLogic Server Environment-70 © 2006 BEA Systems, Inc. 136


Section Review

In this section we discussed:


9 Managing WebLogic Server from the command-line

Configuring a WebLogic Server Environment-71 © 2006 BEA Systems, Inc. 137


Exercise

Using Command-line Administration


f In this exercise you are going to gain experience using
the command-line administration utility.
f Ask the instructor for any clarification.
f The instructor will
determine the stop time.

Lab Exercise

Configuring a WebLogic Server Environment-72 © 2006 BEA Systems, Inc. 138


Module Review

In this module we discussed:


9 The WebLogic Server Administration Console
9 Domain concepts
9 How to create domains
9 How to create and start
Administration server and
managed servers
9 The creation and use of domain
templates

Configuring a WebLogic Server Environment-73 © 2006 BEA Systems, Inc. 139

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy