weblogic 9.1

194
Weblogic Application Server Presented by VAISHALI TAPASWI FANDS INFONET Pvt.Ltd. www.fandsindia.com [email protected]

Upload: harpreet-singh

Post on 03-Jan-2016

41 views

Category:

Documents


0 download

DESCRIPTION

Webmethods

TRANSCRIPT

Page 1: weblogic 9.1

Weblogic Application Server

Presented byVAISHALI TAPASWI

FANDS INFONET [email protected]

Page 2: weblogic 9.1

www.fandsindia.com

Ground Rules

Turn off cell phone. If you cannot, please keep it on silent mode. You can go out and attend your call.If you have questions or issues, please let me know immediately. Let us be punctual.

Page 3: weblogic 9.1

www.fandsindia.com

Agenda

Weblogic Installation and Configuration, Network and Unattended InstallsWLS as a Web ServerSecurity Configuration (Users, Groups, Roles, Policies, SSL)Service Management (JMS, JNDI, JDBC, Transactions)Custom J2EE Class LoadingStartup/Shutdown ClassesApplication Lifecycle Events

Page 4: weblogic 9.1

www.fandsindia.com

Agenda

Performance TuningDevelopment and Production Environment ConfigurationNode ManagerSNMPWLS ClusteringJRockit (Architecture, Features, Configuration, Monitoring)

Page 5: weblogic 9.1

www.fandsindia.com

Agenda

Monitoring (Application, Server)Backup and RestoreNetwork Channel ConfigurationsAdministration ScriptingMessage CatalogJMX Config and Runtime MBeansApplication DeploymentHardening the Production Environment

Page 6: weblogic 9.1

www.fandsindia.com

Day 1

J2ee Architecture Introduction to Weblogic ServerDescribe a high-level view of the WLS ArchitectureInstall BEA Weblogic Platform 8.1

Page 7: weblogic 9.1

www.fandsindia.com

EIS Architecture

Page 8: weblogic 9.1

www.fandsindia.com

Enterprise System Requirements

High AvailabilityLoad-balancingFail OverScalabilitySecurityMaintainability

Page 9: weblogic 9.1

www.fandsindia.com

J2EE Architecture

Page 10: weblogic 9.1

www.fandsindia.com

Distributed Systems

Distributed Systems divide the work amongst several independent moduleFailure of a single module has less impact on the overall system which makes them more :– available– scalable– maintainable

Page 11: weblogic 9.1

www.fandsindia.com

How Standards Help

Many of the advantages of the distributed systems come from standardsStandards– Provide seperation of the difficult problems

to separate platforms– Allow modularization of complex hardware

and software– Allow large portion of project costs to go

toward solving business software needs.

Page 12: weblogic 9.1

www.fandsindia.com

The J2ee Standards

The platform2 enterprise edition (J2EE) helps to ovwercome distributed liabilitiesApplications deployed with the j2ee technologies are:– Standardized– Adherent to specification guidelines– Written in java– Deployable in any complaint application

server

Page 13: weblogic 9.1

www.fandsindia.com

The J2ee architecture

Page 14: weblogic 9.1

www.fandsindia.com

Java ServletsA servlet is a java “program” that executes on the server, accepting client requests and generating dynamic responsesThe most prevalent type of Servlet is an HttpServlet that accepts HTTP requests and generates HTTP responses.Servlets:– do not just generate HTML– can also be used to generate other MIME types, such as

images

Page 15: weblogic 9.1

www.fandsindia.com

Java Server Pages (JSPs)JavaServer Pages are HTML documents interweaved with Java.JSPs:– Provide a dynamic response that is based on the

client's request– Provide for the separation of responsibilities

between Web pesentation and dynamic content– Are portable (write once, run anywhere)

compile and run as servlets

Page 16: weblogic 9.1

www.fandsindia.com

Enterprise Java Beans (EJBs)

EJBs are distributed components written in the Java programming language.EJBs:– provide distributable and deployable business services (logic) to clients– have well-defined interfaces– are reusable across application servers– execute within a container that provides management and control servicesWebLogic Server 9.X supports the EJB 2.1 specification.

Page 17: weblogic 9.1

www.fandsindia.com

JDBC (Java Database Connectivity)

JDBC is:– a standard Java

interface for accessing heterogeneous databases

– a specification that defines four different driver types for connecting to databases

Page 18: weblogic 9.1

www.fandsindia.com

Java Naming & Directory Interface (JNDI)

JNDI is:– a Java API for accessing naming and directory

servers– built as a layer over DNS, LDAP, etc.

Page 19: weblogic 9.1

www.fandsindia.com

Java Transaction API (JTA)JTA is a standard Java API for demarcating

transactions within a program.WebLogic Server supports local and

distributed transactions.

Page 20: weblogic 9.1

www.fandsindia.com

Java Message Service (JMS)JMS is a Java API for accessing

message oriented middleware.The interface supports:

– the Point-to-Point domain– the Publish/Subscribe domain– guaranteed message delivery– transactional participation– dynamically configurable services

– application- or system-scoped resources

– interoperability with othermessaging systems

Page 21: weblogic 9.1

www.fandsindia.com

Java Authentication and Authorization

Java Authentication and Authorization Service (JAAS) is a Java-based security management framework.JAAS supports:– single sign-on– a Pluggable Authentication Module (PAM)JAAS enables flexible control over authorization

whether it is based on:– users– groups– roles

Page 22: weblogic 9.1

www.fandsindia.com

JMXThe Java Management Extensions (JMX):

– defines a standard infrastructure to manage a device from Java programs

– decouples the managed device from the management tools

The specification describes MBeans, which are the building blocks of JMX.

Page 23: weblogic 9.1

www.fandsindia.com

Web ClientA Web client interacts with WLS via HTTP using Servlets/JSPs.Types of Web clients include:

– Browser– Web Services (SOAP over HTTP)

Page 24: weblogic 9.1

www.fandsindia.com

Client Application

A client application interacts with WLS through JRMP/T3, IIOP, COM.Types of Clients include:

– Standalone Java applications– Applets within a browser

Page 25: weblogic 9.1

Introduction to Weblogic Server

Page 26: weblogic 9.1

www.fandsindia.com

Web and Weblogic Server Terms

Web Server

Page 27: weblogic 9.1

www.fandsindia.com

ApplicationServer

Page 28: weblogic 9.1

www.fandsindia.com

Proxy Server

• It forwards the request to other machines• Can be used as level of indirection and security• It can be used for load balancing• Web Servers can act as proxy servers

Page 29: weblogic 9.1

www.fandsindia.com

Firewall

Provides filtering, authorization and authentication serviceshelps keep hackers outCan act as a proxy serverDecrease back-end network activity

Page 30: weblogic 9.1

www.fandsindia.com

A Web Application Server Configuration

Page 31: weblogic 9.1

www.fandsindia.com

Few Definitions

ServerMachineClusterDomainAdministration ServerManaged Server

Page 32: weblogic 9.1

www.fandsindia.com

Server

A server is an instance of weblogic.Serverexecuting in a JVMA server– Runs on a designated

WLS machine– Has a dedicated amount

of RAM– Is multi-threaded

Page 33: weblogic 9.1

www.fandsindia.com

Machine

A machine is a computer that hosts Weblogic Server(s)A machine– Runs a supported

operating system platform

– Can host multiple Weblogic Server instances

Page 34: weblogic 9.1

www.fandsindia.com

Cluster

A cluster is a logical group of WLS serversWeblogic clusters provide automatic:– Fault tolerance– High Availability– Load Balancing

A cluster is transparent to a client

Page 35: weblogic 9.1

www.fandsindia.com

Domain

A domain is a logically-related group of Weblogic Server resources that you manage as a unit.A domain provides one point of administrationA weblogic Server domain can logically separate– Development, test and

production applications– Organizational divisions

Page 36: weblogic 9.1

www.fandsindia.com

Administration Server

An administration (admin) server is the central point of control for a domainAn admin server– Stores the configuration

information and logs for a domain

– Runs the Weblogic Administration console

Page 37: weblogic 9.1

www.fandsindia.com

Managed Server

A managed server is any server in a domain that is not the admin serverA managed server– Contacts the admin

server for configuration information

– Runs business applications in a production environment

Page 38: weblogic 9.1

Install BEA Weblogic Server

Page 39: weblogic 9.1

www.fandsindia.com

Installation Methods

Graphical modeConsole modeSilent mode

Page 40: weblogic 9.1

www.fandsindia.com

Graphical mode

An interactive, GUI-based method for installing WL Platform. It can be run on both Windows and UNIX systems.If you want to run graphical-mode installation, the console attached to the machine on which you are installing the software must support a Java-based GUI. All consoles for Windows systems support Java-based GUIs, but not all consoles for UNIX systems do. If you attempt to start the installation program in graphical mode on a system that cannot support a graphical display, the installation program automatically starts console-mode installation.

Page 41: weblogic 9.1

www.fandsindia.com

Console mode

Console-mode installation is an interactive, text-based method for installing WebLogic Platform, from the command line, on either a UNIX system or a Windows system.

Page 42: weblogic 9.1

www.fandsindia.com

Silent mode

Noninteractive method of installing WebLogic Platform that requires the use of an XML properties file for selecting installation options. You can run silent-mode installation in either of two ways: as part of a script or from the command line. Silent-mode installation is a way of setting installation configurations only once and then using those configurations to duplicate the installation on many machines

Page 43: weblogic 9.1

www.fandsindia.com

Silent mode<?xml version="1.0" encoding="UTF-8"?>

<!-- Silent installer option: -mode=silent -silent_xml=/home/me/silent.xml --><domain-template-descriptor> <input-fields>

<data-value name="BEAHOME" value="C:\bea" />

<data-value name="USER_INSTALL_DIR" value="C:\bea\weblogic81" />

<data-value name="INSTALL_NODE_MANAGER_SERVICE" value="no" />

<data-value name="COMPONENT_PATHS" value="WebLogic Server|WebLogicWorkshop|WebLogic Integration|WebLogic Portal" />

</input-fields>

Page 44: weblogic 9.1

www.fandsindia.com

Practice Session I

Create silent.xml fileInstall weblogic on your system with silent mode installation. Installation should happen in c:\beaSilent folder

Page 45: weblogic 9.1

www.fandsindia.com

After Installation - Observe

Folder hierarchy created after installation.See important batch filesJVM arguments

Page 46: weblogic 9.1

Domain Configuration

Page 47: weblogic 9.1

www.fandsindia.com

Domain Configuration

Configure a DomainConfiguration WizardAdministration Server SettingsCreate a Managed ServerCreate a ClusterCreate a MachineJVM Selection

Page 48: weblogic 9.1

www.fandsindia.com

Templates

Page 49: weblogic 9.1

www.fandsindia.com

Practice Session II

Create a Weblogic Domain– Mydomain123

Create a Weblogic Server– MyServer123

Configure a Machine– Machine123

Page 50: weblogic 9.1

www.fandsindia.com

Weblogic Console

Starting Weblogic Server Stopping Weblogic ServerMaintaining log for ServerConfiguration Files

Page 51: weblogic 9.1

www.fandsindia.com

Server State Diagram

Page 52: weblogic 9.1

www.fandsindia.com

Command Line Administration

Page 53: weblogic 9.1

www.fandsindia.com

Practice Session III

Modify logging properties– All informational messages should be

displayed and stored– Using command line administrations list all

the JNDI names which are registered on the server

– Observe Domain log file and Server log file.

Page 54: weblogic 9.1

www.fandsindia.com

Day 2

JNDIJDBCJMSServlet and JSP applicationEJB

Page 55: weblogic 9.1

JNDI

Page 56: weblogic 9.1

www.fandsindia.com

Understanding JNDI

Describe naming and directory servicesDetail the high-level architecture of JNDIDefine basic terminologyView the JNDI tree in WebLogic ServerUse the Administration Console to deploy

astartup or shutdown class

Page 57: weblogic 9.1

www.fandsindia.com

RoadMap

Introduction to JNDI– What Are Directory and Naming Services and How Do They Work– The High-level Architecture of JNDI– Viewing JNDI Tree Via the Administration Console and the Command-LineStartup and Shutdown Classes

Page 58: weblogic 9.1

www.fandsindia.com

What Is JNDI?

The Java Naming and Directory Interface is an API for accessing different naming and directory services uniformly.This is a major step forward because:

– Different services use vastly different naming schemes– Java applications will be able to navigate seamlessly across databases, files, directories, objects and networks

Page 59: weblogic 9.1

www.fandsindia.com

Why JNDI ?

In WebLogic Server, JNDI serves as a repository and lookup service for J2EE objects including:– EJB home stubs– JDBC DataSources– JMS connection factories, queues and topics– RMI stubs

Page 60: weblogic 9.1

www.fandsindia.com

JNDI Structure

Page 61: weblogic 9.1

www.fandsindia.com

Naming Service

A naming service provides a method for mapping identifiers to entities or objects:

Page 62: weblogic 9.1

www.fandsindia.com

Naming Service

Naming Service vocabulary:

Page 63: weblogic 9.1

www.fandsindia.com

A JNDI Tree

Page 64: weblogic 9.1

www.fandsindia.com

Contexts and SubcontextsSubcontexts are referenced through dot delimiters (.)Subcontexts must be created before objects

are placed into them

Page 65: weblogic 9.1

www.fandsindia.com

JNDI for Administrators

An administrator needs to understand JNDI because it will be their job to:– verify objects are bound in the JNDI tree– set security on contexts within the JNDI tree

Page 66: weblogic 9.1

www.fandsindia.com

Viewing the JNDI Tree

Page 67: weblogic 9.1

www.fandsindia.com

Listing JNDI ContentsWLST provides a command line utility for viewing JNDI bindings.jndi() changes to the jndi tree and ls() lists

the bindings

Page 68: weblogic 9.1

www.fandsindia.com

Section Review

What directory and naming services are and how they workThe high-level architecture of JNDIViewing the JNDI tree via the Administration

Console and the command line

Page 69: weblogic 9.1

www.fandsindia.com

Road MapIntroduction to JNDIStartup and Shutdown Classes– What Are Startup and Shutdown Classes and How Do They Work– Deploying a Startup or Shutdown Class Using the Administration Console

Page 70: weblogic 9.1

www.fandsindia.com

What Is a Startup Class?A startup class is a class that is loaded and executed when WebLogic Server boots.You can use a startup class to:

– initialize objects in memory– reconstruct a JNDI tree– load critical values from the database– recover the system to the state that existed before shutdown

Page 71: weblogic 9.1

www.fandsindia.com

What Is a Shutdown Class?A shutdown class is a class which gets executed when WebLogic Server is shutting down.Shutdown classes are usually used to free

resources obtained by startup classes.

Page 72: weblogic 9.1

www.fandsindia.com

Defining Startup/Shutdown Classes…

Page 73: weblogic 9.1

www.fandsindia.com

…Deploying Startup/Shutdown Classes

Page 74: weblogic 9.1

www.fandsindia.com

When Are Startup Classes Loaded?

By default, startup classes are loaded after the J2EEdeployment units.J2EE deployment units load in this order: JDBC,

JMS,Connectors, EJBs, Web Applications.If “Run Before Application Deployments” is

checked,then startup class are loaded right before deploying JDBC Data Sources.

Page 75: weblogic 9.1

JDBC

Page 76: weblogic 9.1

www.fandsindia.com

JDBC

Java DataBase ConnectivityJDBC is an application programming interface(API) for accessing databases in a uniform wayDifferent Vendors give us jdbc drivers

Page 77: weblogic 9.1

www.fandsindia.com

JDBC Architecture

Page 78: weblogic 9.1

www.fandsindia.com

JDBC Configuration

Creating Connection Pool– Using JDBC Assistant– Script

Testing Connection PoolConnection Configuration Properties– Basic– Advance

Configure Statement CacheMonitor a Connection Pool

Page 79: weblogic 9.1

www.fandsindia.com

DataSource

DataSource object provides a way for a jdbc client to obtain a database connection from a connection poolA DataSource – Is stored in the WLS JNDI tree– Contains a reference to a connection pool– Can support transactions– Must be created for each connection pool

Page 80: weblogic 9.1

www.fandsindia.com

DataSource

Why DataSourceCreate a JDBC DataSourceDeploy a JDBC DataSourceDataSource Vs Transaction DataSource– What is JTA– Distributed Transactions

Page 81: weblogic 9.1

www.fandsindia.com

JDBC - Admin

LoggingMonitoringHow many Connection to establishPerformance Tuning

Page 82: weblogic 9.1

www.fandsindia.com

Practice Session I

Configure a jdbc connection pool to communicate with oracle. When the wls starts 2 connections should be established and it can increase upto 10.Create a DataSource with jndi name as “TestPool”.Use existing jsp to open the connection. Monitor the connection pool for active connections.

Page 83: weblogic 9.1

JMS

Page 84: weblogic 9.1

www.fandsindia.com

JMS

Message-oriented middlewareMessaging Fundamentals– P2P– PS

JMS ArchitectureConfiguring JMS

Page 85: weblogic 9.1

www.fandsindia.com

JMS

Page 86: weblogic 9.1

www.fandsindia.com

Point to Point

Page 87: weblogic 9.1

www.fandsindia.com

Publish Subscribe

Page 88: weblogic 9.1

www.fandsindia.com

JMS Flow

Page 89: weblogic 9.1

www.fandsindia.com

Message-Oriented MiddlewareMessage-oriented middleware refers to an

infrastructure that supports messaging.Typical message-oriented middleware

architectures define these elements:– Message structure– The way to send and receive messages– Scaling guidelines

Page 90: weblogic 9.1

www.fandsindia.com

Point-to-Point (PTP) QueueMany producers can serialize messages to

multiple receivers in a queue.

Page 91: weblogic 9.1

www.fandsindia.com

Publish-Subscribe TopicsPublishing and subscribing to a topic

decouples producers from consumers.

Page 92: weblogic 9.1

www.fandsindia.com

WebLogic Server JMS Features

WebLogic Server JMS supports:– PTP and Pub/sub domains– Guaranteed and transactional message

delivery– Durable subscribers– Distributed destinations– Recovery from failed servers

Page 93: weblogic 9.1

www.fandsindia.com

JMS Architecture: Connecting

Page 94: weblogic 9.1

www.fandsindia.com

JMS Architecture: Sending Messages

Page 95: weblogic 9.1

www.fandsindia.com

Transacted MessagingA JMS client can use JTA to participate in

a distributed transaction.Alternatively, a JMS client can demarcate

transactions local to the JMS Session, through a transacted session.Participation in a transaction is optional.

Page 96: weblogic 9.1

www.fandsindia.com

Administrative TasksAdministrative tasks include these:

– Creating and monitoring JMS Servers– Creating connection factories– Creating and monitoring destinations– Creating JMS stores– Configuring thresholds and quotas– Configuring durable subscriptions– Managing JMS service fail-over

Page 97: weblogic 9.1

www.fandsindia.com

WLS JMS ServerIn WLS, the messaging service is implemented

through a JMS Server.A JMS Server receives and distributes

messages.

Page 98: weblogic 9.1

www.fandsindia.com

Create a JMS Server

Page 99: weblogic 9.1

www.fandsindia.com

Target a JMS Server

Page 100: weblogic 9.1

www.fandsindia.com

Configure a JMS Server

Page 101: weblogic 9.1

www.fandsindia.com

JMS ResourcesJMS resources are managed as system

modules, application modules, or packaged JDBC resource modules.

Page 102: weblogic 9.1

www.fandsindia.com

Modular JMS Resource Configuration and Deployment...

JMS configurations in WebLogic Server are stored as modules

– Defined by an XML file that conforms to the weblogicjmsmd.xsd schema

– Similar to standard J2EE modulesAn administrator can create and manage JMS

modules as:– Global system resources– Global standalone modules– Modules packaged with an enterprise application

Page 103: weblogic 9.1

www.fandsindia.com

Modular JMS ResourceConfiguration and Deployment

An advantage of modular deployment is simplified migration between environments, such as:

– From development to integration– From system test to production

You can migrate your application and the required JMS configuration:

– Without opening an EAR file– Without extensive manual JMS reconfiguration

Page 104: weblogic 9.1

www.fandsindia.com

Connection FactoryA connection factory:

– Encapsulates connection configuration information– Is used to create pre-configured connections– Is stored in JNDI– Can be targeted to servers or clusters

WLS provides a default connection factory that is bound in JNDI to weblogic.jms.ConnectionFactory.When a new configuration is required, a new

connection factory can be created.

Page 105: weblogic 9.1

www.fandsindia.com

Practice Session II

Configure – Connection Factory – Queue– Topic

Page 106: weblogic 9.1

www.fandsindia.com

Day 3

Web ApplicationsJTASecurityRuntime Configurations (for clustering)

Page 107: weblogic 9.1

Web Applications

Page 108: weblogic 9.1

www.fandsindia.com

Web Applications

Any web application is a group of server side resources

• Servlets• Java Server Pages (JSP)• Static Documents (HTML, images)• Server Side classes• Client side applets and Beans• Tag Libraries

Page 109: weblogic 9.1

www.fandsindia.com

Web Application

Packaging and Deploying a war file– Extracted folder deployment– War deployment– When to choose what

Configuring a war file– Weblogic.xml

Page 110: weblogic 9.1

www.fandsindia.com

Command-Line Deployment

Weblogic.deployer utilityjava weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name myapp -targets myserver -upload

-deploy c:\localfiles\myapp.ear

Page 111: weblogic 9.1

www.fandsindia.com

Virtual Hosts

A virtual host– Has associated web addresses : domain

name and IP address– Lets you make one web server function as

if it were multiple serversUser virtual hosting to allow one web server to host multiple internal and external corporate sites

Page 112: weblogic 9.1

www.fandsindia.com

Virtual Hosts

Page 113: weblogic 9.1

www.fandsindia.com

Configure a Virtual Host

Steps to configure a virtual host– Create the virtual host in the admin

console– Target the virtual host to a server– Target applications to the virtual host– Resolve DNS names in the system host file

Page 114: weblogic 9.1

www.fandsindia.com

Practice Session I

Try deploying a web application using– War deployment– Folder deployment

Create a virtual host and test web application.Test virtual host– http://fands.com:7001/test

Page 115: weblogic 9.1

Java Transaction API (JTA)

Page 116: weblogic 9.1

www.fandsindia.com

JTA

What is distributed transaction– Resource Manager– Local Transactions– Transaction Manager– Transaction Context

Page 117: weblogic 9.1

www.fandsindia.com

Two Phase Commit Protocol

2 steps to commit changesPhase 1 – asks RMs to prepare to make the changes and if any of them cannot, the transaction is abortedPhase 2 – asks RMs to commit and make the changes permanentA global transaction ID is used to track all changes associated with a distributed transaction

Page 118: weblogic 9.1

www.fandsindia.com

Role of Administrator

Configure transactions at the domain levelMonitor transactions on a server– By resource– By name

Transaction Log

Page 119: weblogic 9.1

www.fandsindia.com

Role of Administrator

Transaction Recovery after Server FailureTransaction Recovery ServiceRecovering Transactions for a failed non-clustered server– Move transaction log files from failed server to a

new server– Set transactionlogfileprefix– Start new server – searches for incomplete

transactions and completes them

Page 120: weblogic 9.1

Security

Page 121: weblogic 9.1

www.fandsindia.com

Security

Weblogic Security ArchitectureUser and GroupsRolesProtecting Application ResourcesProtecting CommunicationProtecting against Attacks

Page 122: weblogic 9.1

www.fandsindia.com

Security Architecture

Page 123: weblogic 9.1

www.fandsindia.com

Providers

Authentication Provider– Authenticate users within a security realm– Transport identity information

Authorization Provider– A process to control interactions between users

and resources based on user identity– Role Mapping

Adjudication Provider– Can be used to tally the results that multiple

access decisions return to determine the final decision

Page 124: weblogic 9.1

www.fandsindia.com

Providers

Confidentiality– SSL – Client Certificate and public ID

Credential Mapping– For accessing legacy system authentication

mechanism to obtain a set of credentialsAuditing– Provides a trail of activity

Page 125: weblogic 9.1

www.fandsindia.com

Security Realm

Collection of System Resources and Security service providersOne security realm can be active at a timeEach user and group must be defined in security realmCreating a security realm is an administration task

Page 126: weblogic 9.1

www.fandsindia.com

Lets do it now

Setting Security settingsUsers, roles etcRealm ConfigurationUser lockoutsProtecting against attacksSSLSetting up security for applications

Page 127: weblogic 9.1

www.fandsindia.com

Day 4

Runtime ConfigurationsClustering

Page 128: weblogic 9.1

RUNTIME CONFIGURATIONS

Page 129: weblogic 9.1

www.fandsindia.com

RUNTIME CONFIGURATIONS

Node ManagerManaged Server IndependenceNetwork ChannelsStartup and Shutdown Classes

Page 130: weblogic 9.1

www.fandsindia.com

Node Manager

Is an independent java programMonitors and acts on server healthRuns on the same computers as the managed serversReceives its requests from the admin server through the console or Weblogic.adminCan be run automatically in the background, as a windows service or a Unix daemon

Page 131: weblogic 9.1

www.fandsindia.com

Node Manager Architecture

Page 132: weblogic 9.1

www.fandsindia.com

LETS DO IT

Set up node manager– Configure hosts– Define machines– Specify server start information– Start node manager

• At the command line• With a start script• As windows service or Unix daemon

– Start/stop managed servers remotely

Page 133: weblogic 9.1

www.fandsindia.com

Server Status

Status of server can be monitoredServer stdout can be viewedStarting all the servers in DomainNode Manager log filesUsing self-health with node manager

Page 134: weblogic 9.1

www.fandsindia.com

Self Health

Node manager can reboot failed server automaticallyNo manual intervention requiredHealth state is not visible through the consoleCan programmatically checked by JMXConfigure using Console

Page 135: weblogic 9.1

www.fandsindia.com

Server Administration

What happens when admin server is down (managed Server independence) ?Console – server tuningReplicating Domain config filesAdmin Server backupDiscovery mode– For reconnecting to managed servers

Page 136: weblogic 9.1

www.fandsindia.com

Network Channels

Gives flexibility to network configurations– Multiple NICs (Network Interface Card) for

a single WLS Server– Multiple IP addresses for each server– One IP address with each server– Secure Channels

Page 137: weblogic 9.1

www.fandsindia.com

Startup and Shutdown Classes

A startup class is loaded and executed when Weblogic server bootsUsed to– Initialize objects in memory– Modify JNDI tree– Load critical values from database

Connector Modules

Page 138: weblogic 9.1

Clustering

Page 139: weblogic 9.1

www.fandsindia.com

Clustering

ConceptsHardware Load BalancersWeb Server PluginsWLS J2EE Clustering

Page 140: weblogic 9.1

www.fandsindia.com

Concepts

A cluster is a collection of entities coordinating actions to provide scalable and highly-available services.– Scalable services

• Add and remove servers as needed• Load balance requests• Concentrate communication

– Highly available services• No single point of failure• Transparent failover

Page 141: weblogic 9.1

www.fandsindia.com

Support

Services that can be clustered– Web Applications– EJB and RMI objects– JNDI Tree

Services where limited support is avaiable– JDBC Connections– JMS Connection factories

Page 142: weblogic 9.1

www.fandsindia.com

Support

Services which can not be clustered– File Services– Time Services

Page 143: weblogic 9.1

www.fandsindia.com

Cluster Architecture

Page 144: weblogic 9.1

www.fandsindia.com

Cluster Architecture

Page 145: weblogic 9.1

www.fandsindia.com

Hardware Load Balancer

Stateless services– Choose any load balancing policy available– No need for server affinity

Server

Server

Server

Server

Server

Server

Server

Server

Web Servers Application Servers

Load balancer

Page 146: weblogic 9.1

www.fandsindia.com

Hardware Load Balancer

Stateful services– Choose any load balancing policy for initial

request– Maintain server affinity based on HTTP

cookies– NO load balancing after session is

established

Page 147: weblogic 9.1

www.fandsindia.com

Hardware Load Balancers

Passive Cookie Persistence– Server affinity based on cookie set by

WebLogic serverActive Cookie Persistence– Server affinity based on cookie set by load

balancer– Shouldn’t modify cookie set by WebLogic

server• No support for URL rewriting.

Page 148: weblogic 9.1

www.fandsindia.com

Page 149: weblogic 9.1

www.fandsindia.com

Page 150: weblogic 9.1

www.fandsindia.com

Design of Web Server Plugins

Cookie based server persistenceActive Cookie Persistence

– Add custom cookie to maintain persistence

Web Server/LB

Server-1

Server1Server-

2Server 2Server-

3Server 3

GET /Helloworld.jsp

GET /Helloworld.jsp

JSESSIONID=sf1D49;

JSESSIONID=a31Kz0;

JSESSIONID=sf1d49;Server=Server-1

JSESSIONID=a31Kz0;Server=Server-3GET /index.jsp GET /index.jsp

Page 151: weblogic 9.1

www.fandsindia.com

Design of Web Server Plugins

Load Balancer Discovery ProtocolStatic RegistrationDynamic RegistrationIP Multicast protocolNotification at startup/shutdown– F5 provides a SOAP based scheme to achieve

this– http://dev2dev.bea.com/codelibrary/code/f5_wls.js

p

Page 152: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering

Multicast is used to – Derive cluster membership

• Failure to receive 3 heartbeats mark server dead

– Service advertisement

Page 153: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering

Naming ServiceStateless Services – Stateless session beans

Stateful Services– HTTP Sessions – Stateful session beans– Entity Beans

JMS

Page 154: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering/Naming Service

DNS Based Naming Service

OpenBSD Based Naming Service

Page 155: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering/Naming Service

DNS Based Naming Service

DNS does initial connection load balancingUnique address per server1 address that resolves to all server addresses – Limited to round-robin– Performance dependent on DNS server’s specs– No health checks

Page 156: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering/Naming Service

OpenBSD based Naming ServicePacketFilter does initial connection load balancing

Unique address per server– Round-robin, source-address hash, bitmask,

random– Inexpensive to make redundant– Flexible health checks

http://dev2dev.bea.com/codelibrary/code/openbsd_lb.jsp

Page 157: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering/Naming ServiceEvery server in the cluster provides the same JNDI tree view

Changes to the local JNDI tree will be sent to the entire cluster via multicast.

Objects bound in JNDI should either be Remote or Serializable to get replicated.

Page 158: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering/Naming ServicePrior to 8.1, JNDI service replication is only done using multicast

In 8.1, it is a combination of multicast and point-to-point connection– JNDI tree synchronization is way faster– No more multicast storms

Page 159: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering/Naming Service

Useful flags: Controlling JNDI object replication– RMI objects:

Hashtable h = new Hashtable();h.put(“weblogic.jndi.replicateBindings”, “false”);

or h.put(WLContext.REPLICATE_BINDINGS, “false”);

orEnvironment env = new Environment();env.setReplicateBindings(false);

– EJBs: clients-on-same-server=“true” in weblogicejb deployment descriptor

Page 160: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering/Naming Service

Useful flags:– Cluster attribute

MemberWarmupTimeoutSeconds

• Discover & sync in 7.0 is 60 seconds• Discover & sync in 8.1 is 30 seconds• At most 30 seconds in Diablo.

Page 161: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / EJB’s

For high availability

Make your EJB’s cluster-aware

Mark business methods idempotent (where possible)– Duplicate requests has no negative side-effects – weblogic.rmic flag -methodsAreIdempotent for

RMI objects – <!ELEMENT idempotent-methods (method*)> in

weblogic ejb deployment descriptor.

Page 162: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / EJB’s

For scalability– Choose appropriate load balancing policy– Can be defined at the cluster level

Algorithms– Round robin– Random– Weight– Server Affinity

Page 163: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / EJB’s

Server Affinity

The server affinity algorithms consider existing connections between an external Java client and server instances in balancing the client load among WebLogic server instancesIn the case of failure, causes the client to failover to a server instance to which it has an open connection

Page 164: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / Stateless Services

Stateless Session Beans

Scales wellEasy to provide multiple instances of the same serviceEasy to provide load balancing and failoverThe methods on stateless session bean home are marked idempotent weblogic.ejbccompiler

Page 165: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / StatefulservicesStateful Session EJB

Pinned to one serverMay be replicated to improve fault-toleranceMay lose some or all state in unusual failuresIf using replication, idempotent methods improve availability

Page 166: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / StatefulservicesEntity EJB

Use Optimistic Caching for EJBs

When appropriate use read-only beans– EJBC tags all methods as idempotent

Page 167: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / Statefulservices

HTTP Session Persistence Algorithms

In Memory Replication

Database based session persistence

File based session persistence

Page 168: weblogic 9.1

www.fandsindia.com

In Memory Replication: State is replicated to secondary server in a clustersetAttribute(), removeAttribute() trigger state replicationPros:– Scales really well– Reliable

Cons– Might lose state

WLS J2EE Clustering / Statefulservices

Page 169: weblogic 9.1

www.fandsindia.com

Configuration Aspects– Replication Groups– Assign server to machine

Criteria for secondary server selection– Different Machine, Preferred Replication Group– Different Machine, Not in Preferred Replication

Group– Same Machine, Preferred Replication Group– Same Machine, Not in Preferred Replication

GroupAutomatic secondary placement in next release

WLS J2EE Clustering / Statefulservices

Page 170: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / Statefulservices

Database based session persistence– Very reliable– Slower than In Memory Replication– Number of DB connections proportional to load

File based session persistence– As reliable as the file system– Scalability might be a problem– Slowest of all the persistent schemes

Page 171: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / Statefulservices

Diablo HTTP Session Debugging features

– Size of each serializable/remote object in session

– Identify non-serializable objects in session.

Page 172: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / Deployment Single Tier Architecture

EJB’s & Servlet’s are co-located in the same server.Advantages– Easier to manage– Simpler application design– Increases availability by hosting each service on

every server– Best performanceDisadvantages– Scaling individual tiers is not possible

Page 173: weblogic 9.1

www.fandsindia.com

WLS J2EE Clustering / Deployment

Two Tier ArchitectureEJB’s & Servlet’s are in different servers.Advantages– Allows individual tier scalingDisadvantages– Less Locality– More complex design– Performance overhead

Page 174: weblogic 9.1

www.fandsindia.com

LETS DO IT

Set up node manager– Create a Cluster – Add machines to Cluster– Add Servers to Cluster– Start Servers in Cluster– Monitor Cluster– Deploy a application in Cluster– Proxy Server

Page 175: weblogic 9.1

www.fandsindia.com

Day 5

Monitoring (Application, Server)SNMPJMX Config and Runtime MBeansBackup and RestorePerformance Tuning

Page 176: weblogic 9.1

www.fandsindia.com

Monitoring (Applications, Server)

Connection PoolsJMSApplicationsDomain ClusterReading and filtering logJRockit

Page 177: weblogic 9.1

www.fandsindia.com

SNMP

An Administration Server has the ability to function as a Simple Network Management Protocol (SNMP) agent. The Weblogic SNMP agent runs as a service that responds to requests from SNMP managers and sends SNMP trap notifications to SNMP managers. This page allows you to define the SNMP configuration of this Weblogic Server domain.

Page 178: weblogic 9.1

www.fandsindia.com

SNMP Agent’s Role in WLS Domain

Page 179: weblogic 9.1

www.fandsindia.com

JMX Config and Runtime MBeans

Resources on WebLogic Server instances use Java Management Extensions (JMX) Managed Beans (MBeans) to expose their management functions. An MBeanis a concrete Java class that is developed in accordance with JMX specifications. It can provide getter and setter operations for each management attribute within a managed resource along with additional management operations that the resource makes available.

Page 180: weblogic 9.1

www.fandsindia.com

JMX Config and Runtime MBeansWebLogic Server MBeans that expose the

configuration data of a managed resource are called Configuration MBeans while MBeans that provide performance metrics and other information about the runtime state of a managed resource are called Runtime MBeans. E.g. a ServerMBeanConfiguration MBean indicates the listen port for a server instance while the ServerRuntimeMBean Runtime MBean indicates the current lifecycle state of a server instance.

Page 181: weblogic 9.1

www.fandsindia.com

Backup and Restore

Backup of Config file – Previous version– Start of the server

Backing up security data– Import / export

Restarting Servers– Admin– Managed

Page 182: weblogic 9.1

Performance Tuning

Page 183: weblogic 9.1

www.fandsindia.com

Basic Terminologies

Performance– Response Time – a time metric– Throughput – A rate metric (requests per

unit of time) e.g. requests per second– Resource Utilization

Scalability– Users– Data

Page 184: weblogic 9.1

www.fandsindia.com

Load and Stress Testing

Load Testing– Test the application for concurrent request

loadsStress Testing– Test systems limits– E.g. max concurrent users, max data

volumePerformance Testing

Page 185: weblogic 9.1

www.fandsindia.com

Benchmark

A benchmark is a performance measurement of a system meant for use in comparisonsBenchmark should be as realistic as possible– Database access– Test environment similar to production

environment

Page 186: weblogic 9.1

www.fandsindia.com

Steps

Preparing a metricsReporting the results in predefined, well-planned, tabular formatStore it in the databaseMethodologies

Page 187: weblogic 9.1

www.fandsindia.com

Methodology

Page 188: weblogic 9.1

www.fandsindia.com

Tools

Performance Testing ToolsOs-specific monitoring toolsThe Grinder

Page 189: weblogic 9.1

www.fandsindia.com

Performance Testing Tools

Load RunnerE-loadSilk performer

Page 190: weblogic 9.1

www.fandsindia.com

Os-specific monitoring tools

Windows– Windows Task Manager– Windows Performance Monitor

Unix– sar– Mpstat– Vmstat,Netstat,Iostat

Page 191: weblogic 9.1

www.fandsindia.com

The Grinder

Typical general purpose load testingOpen SourceInstalling and load testing grinderSee example

Page 192: weblogic 9.1

www.fandsindia.com

JVM Tuning and JRockit

JVM tuning– Parameters

• -ms384m• -mx400m

Monitoring JVM memoryJRockit– Advantages– Monitoring

Page 193: weblogic 9.1

www.fandsindia.com

QUESTION / ANSWERS

Page 194: weblogic 9.1

www.fandsindia.com

THANKING YOU !