weblogic 9.1
-
Upload
harpreet-singh -
Category
Documents
-
view
44 -
download
0
description
Transcript of 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.
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
www.fandsindia.com
Agenda
Performance TuningDevelopment and Production Environment ConfigurationNode ManagerSNMPWLS ClusteringJRockit (Architecture, Features, Configuration, Monitoring)
www.fandsindia.com
Agenda
Monitoring (Application, Server)Backup and RestoreNetwork Channel ConfigurationsAdministration ScriptingMessage CatalogJMX Config and Runtime MBeansApplication DeploymentHardening the Production Environment
www.fandsindia.com
Day 1
J2ee Architecture Introduction to Weblogic ServerDescribe a high-level view of the WLS ArchitectureInstall BEA Weblogic Platform 8.1
www.fandsindia.com
EIS Architecture
www.fandsindia.com
Enterprise System Requirements
High AvailabilityLoad-balancingFail OverScalabilitySecurityMaintainability
www.fandsindia.com
J2EE Architecture
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
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.
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
www.fandsindia.com
The J2ee architecture
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
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
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.
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
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.
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.
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
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
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.
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)
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
Introduction to Weblogic Server
www.fandsindia.com
Web and Weblogic Server Terms
Web Server
www.fandsindia.com
ApplicationServer
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
www.fandsindia.com
Firewall
Provides filtering, authorization and authentication serviceshelps keep hackers outCan act as a proxy serverDecrease back-end network activity
www.fandsindia.com
A Web Application Server Configuration
www.fandsindia.com
Few Definitions
ServerMachineClusterDomainAdministration ServerManaged Server
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
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
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
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
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
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
Install BEA Weblogic Server
www.fandsindia.com
Installation Methods
Graphical modeConsole modeSilent mode
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.
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.
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
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>
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
www.fandsindia.com
After Installation - Observe
Folder hierarchy created after installation.See important batch filesJVM arguments
Domain Configuration
www.fandsindia.com
Domain Configuration
Configure a DomainConfiguration WizardAdministration Server SettingsCreate a Managed ServerCreate a ClusterCreate a MachineJVM Selection
www.fandsindia.com
Templates
www.fandsindia.com
Practice Session II
Create a Weblogic Domain– Mydomain123
Create a Weblogic Server– MyServer123
Configure a Machine– Machine123
www.fandsindia.com
Weblogic Console
Starting Weblogic Server Stopping Weblogic ServerMaintaining log for ServerConfiguration Files
www.fandsindia.com
Server State Diagram
www.fandsindia.com
Command Line Administration
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.
www.fandsindia.com
Day 2
JNDIJDBCJMSServlet and JSP applicationEJB
JNDI
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
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
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
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
www.fandsindia.com
JNDI Structure
www.fandsindia.com
Naming Service
A naming service provides a method for mapping identifiers to entities or objects:
www.fandsindia.com
Naming Service
Naming Service vocabulary:
www.fandsindia.com
A JNDI Tree
www.fandsindia.com
Contexts and SubcontextsSubcontexts are referenced through dot delimiters (.)Subcontexts must be created before objects
are placed into them
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
www.fandsindia.com
Viewing the JNDI Tree
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
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
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
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
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.
www.fandsindia.com
Defining Startup/Shutdown Classes…
www.fandsindia.com
…Deploying Startup/Shutdown Classes
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.
JDBC
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
www.fandsindia.com
JDBC Architecture
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
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
www.fandsindia.com
DataSource
Why DataSourceCreate a JDBC DataSourceDeploy a JDBC DataSourceDataSource Vs Transaction DataSource– What is JTA– Distributed Transactions
www.fandsindia.com
JDBC - Admin
LoggingMonitoringHow many Connection to establishPerformance Tuning
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.
JMS
www.fandsindia.com
JMS
Message-oriented middlewareMessaging Fundamentals– P2P– PS
JMS ArchitectureConfiguring JMS
www.fandsindia.com
JMS
www.fandsindia.com
Point to Point
www.fandsindia.com
Publish Subscribe
www.fandsindia.com
JMS Flow
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
www.fandsindia.com
Point-to-Point (PTP) QueueMany producers can serialize messages to
multiple receivers in a queue.
www.fandsindia.com
Publish-Subscribe TopicsPublishing and subscribing to a topic
decouples producers from consumers.
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
www.fandsindia.com
JMS Architecture: Connecting
www.fandsindia.com
JMS Architecture: Sending Messages
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.
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
www.fandsindia.com
WLS JMS ServerIn WLS, the messaging service is implemented
through a JMS Server.A JMS Server receives and distributes
messages.
www.fandsindia.com
Create a JMS Server
www.fandsindia.com
Target a JMS Server
www.fandsindia.com
Configure a JMS Server
www.fandsindia.com
JMS ResourcesJMS resources are managed as system
modules, application modules, or packaged JDBC resource modules.
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
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
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.
www.fandsindia.com
Practice Session II
Configure – Connection Factory – Queue– Topic
www.fandsindia.com
Day 3
Web ApplicationsJTASecurityRuntime Configurations (for clustering)
Web Applications
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
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
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
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
www.fandsindia.com
Virtual Hosts
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
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
Java Transaction API (JTA)
www.fandsindia.com
JTA
What is distributed transaction– Resource Manager– Local Transactions– Transaction Manager– Transaction Context
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
www.fandsindia.com
Role of Administrator
Configure transactions at the domain levelMonitor transactions on a server– By resource– By name
Transaction Log
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
Security
www.fandsindia.com
Security
Weblogic Security ArchitectureUser and GroupsRolesProtecting Application ResourcesProtecting CommunicationProtecting against Attacks
www.fandsindia.com
Security Architecture
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
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
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
www.fandsindia.com
Lets do it now
Setting Security settingsUsers, roles etcRealm ConfigurationUser lockoutsProtecting against attacksSSLSetting up security for applications
www.fandsindia.com
Day 4
Runtime ConfigurationsClustering
RUNTIME CONFIGURATIONS
www.fandsindia.com
RUNTIME CONFIGURATIONS
Node ManagerManaged Server IndependenceNetwork ChannelsStartup and Shutdown Classes
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
www.fandsindia.com
Node Manager Architecture
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
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
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
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
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
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
Clustering
www.fandsindia.com
Clustering
ConceptsHardware Load BalancersWeb Server PluginsWLS J2EE Clustering
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
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
www.fandsindia.com
Support
Services which can not be clustered– File Services– Time Services
www.fandsindia.com
Cluster Architecture
www.fandsindia.com
Cluster Architecture
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
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
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.
www.fandsindia.com
www.fandsindia.com
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
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
www.fandsindia.com
WLS J2EE Clustering
Multicast is used to – Derive cluster membership
• Failure to receive 3 heartbeats mark server dead
– Service advertisement
www.fandsindia.com
WLS J2EE Clustering
Naming ServiceStateless Services – Stateless session beans
Stateful Services– HTTP Sessions – Stateful session beans– Entity Beans
JMS
www.fandsindia.com
WLS J2EE Clustering/Naming Service
DNS Based Naming Service
OpenBSD Based Naming Service
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
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
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.
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
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
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.
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.
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
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
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
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
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
www.fandsindia.com
WLS J2EE Clustering / Statefulservices
HTTP Session Persistence Algorithms
In Memory Replication
Database based session persistence
File based session persistence
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
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
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
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.
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
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
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
www.fandsindia.com
Day 5
Monitoring (Application, Server)SNMPJMX Config and Runtime MBeansBackup and RestorePerformance Tuning
www.fandsindia.com
Monitoring (Applications, Server)
Connection PoolsJMSApplicationsDomain ClusterReading and filtering logJRockit
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.
www.fandsindia.com
SNMP Agent’s Role in WLS Domain
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.
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.
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
Performance Tuning
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
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
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
www.fandsindia.com
Steps
Preparing a metricsReporting the results in predefined, well-planned, tabular formatStore it in the databaseMethodologies
www.fandsindia.com
Methodology
www.fandsindia.com
Tools
Performance Testing ToolsOs-specific monitoring toolsThe Grinder
www.fandsindia.com
Performance Testing Tools
Load RunnerE-loadSilk performer
www.fandsindia.com
Os-specific monitoring tools
Windows– Windows Task Manager– Windows Performance Monitor
Unix– sar– Mpstat– Vmstat,Netstat,Iostat
www.fandsindia.com
The Grinder
Typical general purpose load testingOpen SourceInstalling and load testing grinderSee example
www.fandsindia.com
JVM Tuning and JRockit
JVM tuning– Parameters
• -ms384m• -mx400m
Monitoring JVM memoryJRockit– Advantages– Monitoring
www.fandsindia.com
QUESTION / ANSWERS
www.fandsindia.com
THANKING YOU !