Beruflich Dokumente
Kultur Dokumente
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 Installs WLS as a Web Server Security Configuration (Users, Groups, Roles, Policies, SSL) Service Management (JMS, JNDI, JDBC, Transactions) Custom J2EE Class Loading Startup/Shutdown Classes Application Lifecycle Events
www.fandsindia.com
Agenda
Performance Tuning Development and Production Environment Configuration Node Manager SNMP WLS Clustering JRockit (Architecture, Features, Configuration, Monitoring)
www.fandsindia.com
Agenda
Monitoring (Application, Server) Backup and Restore Network Channel Configurations Administration Scripting Message Catalog JMX Config and Runtime MBeans Application Deployment Hardening the Production Environment
www.fandsindia.com
Day 1
J2ee Architecture Introduction to Weblogic Server Describe a high-level view of the WLS Architecture Install BEA Weblogic Platform 8.1
www.fandsindia.com
EIS Architecture
www.fandsindia.com
J2EE Architecture
www.fandsindia.com
Distributed Systems
Distributed Systems divide the work amongst several independent module Failure of a single module has less impact on the overall system which makes them more :
available scalable maintainable
www.fandsindia.com
Many of the advantages of the distributed systems come from standards Standards
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 platform2 enterprise edition (J2EE) helps to ovwercome distributed liabilities Applications deployed with the j2ee technologies are:
Standardized Adherent to specification guidelines Written in java Deployable in any complaint application server
www.fandsindia.com
www.fandsindia.com
Java Servlets
A servlet is a java program that executes on the server, accepting client requests and generating dynamic responses The 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
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 services WebLogic Server 9.X supports the EJB 2.1 specification.
www.fandsindia.com
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
JNDI is:
a Java API for accessing naming and directory servers built as a layer over DNS, LDAP, etc.
www.fandsindia.com
JTA is a standard Java API for demarcating transactions within a program. WebLogic Server supports local and distributed transactions.
www.fandsindia.com
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 other messaging systems
www.fandsindia.com
www.fandsindia.com
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 Client
A 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:
www.fandsindia.com
Web Server
www.fandsindia.com
Application Server
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 services helps keep hackers out Can act as a proxy server Decrease back-end network activity
www.fandsindia.com
www.fandsindia.com
Few Definitions
Server
www.fandsindia.com
Machine
www.fandsindia.com
Cluster
www.fandsindia.com
Domain
A domain is a logicallyrelated group of Weblogic Server resources that you manage as a unit. A domain provides one point of administration A 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 domain An 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 server A managed server
Contacts the admin server for configuration information Runs business applications in a production environment
www.fandsindia.com
Installation Methods
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 www.fandsindia.com automatically starts console-mode installation.
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 silentmode 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|WebLogic www.fandsindia.com Workshop|WebLogic Integration|WebLogic Portal" /> </input-fields>
Practice Session I
Create silent.xml file Install weblogic on your system with silent mode installation. Installation should happen in c:\beaSilent folder
www.fandsindia.com
Folder hierarchy created after installation. See important batch files JVM arguments
www.fandsindia.com
Domain Configuration
Domain Configuration
Configure a Domain Configuration Wizard Administration Server Settings Create a Managed Server Create a Cluster Create a Machine JVM Selection
www.fandsindia.com
Templates
www.fandsindia.com
Practice Session II
Configure a Machine
Machine123
www.fandsindia.com
Weblogic Console
Starting Weblogic Server Stopping Weblogic Server Maintaining log for Server Configuration Files
www.fandsindia.com
www.fandsindia.com
www.fandsindia.com
Day 2
www.fandsindia.com
JNDI
Understanding JNDI
Describe naming and directory services Detail the high-level architecture of JNDI Define basic terminology View the JNDI tree in WebLogic Server Use the Administration Console to deploy a startup 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 CommandLine Startup 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
www.fandsindia.com
Naming Service
www.fandsindia.com
A JNDI Tree
www.fandsindia.com
Subcontexts are referenced through dot delimiters (.) Subcontexts must be created before objects are placed into them
www.fandsindia.com
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
www.fandsindia.com
WLST 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 work The high-level architecture of JNDI Viewing the JNDI tree via the Administration Console and the command line
www.fandsindia.com
Road Map
Introduction to JNDI Startup 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
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
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
www.fandsindia.com
www.fandsindia.com
By default, startup classes are loaded after the J2EE deployment 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.
www.fandsindia.com
JDBC
JDBC
Java DataBase Connectivity JDBC is an application programming interface(API) for accessing databases in a uniform way Different Vendors give us jdbc drivers
www.fandsindia.com
JDBC Architecture
www.fandsindia.com
JDBC Configuration
DataSource
DataSource object provides a way for a jdbc client to obtain a database connection from a connection pool A 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 DataSource Create a JDBC DataSource Deploy a JDBC DataSource DataSource Vs Transaction DataSource
What is JTA Distributed Transactions
www.fandsindia.com
JDBC - Admin
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.
www.fandsindia.com
JMS
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 Middleware
Message-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
www.fandsindia.com
Publish-Subscribe Topics
www.fandsindia.com
www.fandsindia.com
www.fandsindia.com
www.fandsindia.com
Transacted Messaging
A 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 Tasks
Administrative 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
In WLS, the messaging service is implemented through a JMS Server. A JMS Server receives and distributes messages.
www.fandsindia.com
www.fandsindia.com
www.fandsindia.com
www.fandsindia.com
JMS Resources
JMS resources are managed as system modules, application modules, or packaged JDBC resource modules.
www.fandsindia.com
www.fandsindia.com
www.fandsindia.com
Connection Factory
A 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
www.fandsindia.com
Web Applications
Web Applications
Web Application
www.fandsindia.com
Command-Line Deployment
Weblogic.deployer utility java 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 servers
User virtual hosting to allow one web server to host multiple internal and external corporate sites
www.fandsindia.com
Virtual Hosts
www.fandsindia.com
www.fandsindia.com
Practice Session I
Create a virtual host and test web application. Test virtual host
http://fands.com:7001/test
www.fandsindia.com
JTA
www.fandsindia.com
2 steps to commit changes Phase 1 asks RMs to prepare to make the changes and if any of them cannot, the transaction is aborted Phase 2 asks RMs to commit and make the changes permanent A global transaction ID is used to track all changes associated with a distributed transaction
www.fandsindia.com
Role of Administrator
Transaction Log
www.fandsindia.com
Role of Administrator
Transaction Recovery after Server Failure Transaction Recovery Service Recovering Transactions for a failed nonclustered server
Move transaction log files from failed server to a new server Set transactionlogfileprefix Start new server searches for incomplete transactions and completes them
www.fandsindia.com
Security
Security
Weblogic Security Architecture User and Groups Roles Protecting Application Resources Protecting Communication Protecting 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 credentials
Auditing
Provides a trail of activity
www.fandsindia.com
Security Realm
Collection of System Resources and Security service providers One security realm can be active at a time Each user and group must be defined in security realm Creating a security realm is an administration task
www.fandsindia.com
Lets do it now
Setting Security settings Users, roles etc Realm Configuration User lockouts Protecting against attacks SSL Setting up security for applications
www.fandsindia.com
Day 4
www.fandsindia.com
RUNTIME CONFIGURATIONS
RUNTIME CONFIGURATIONS
Node Manager Managed Server Independence Network Channels Startup and Shutdown Classes
www.fandsindia.com
Node Manager
Is an independent java program Monitors and acts on server health Runs on the same computers as the managed servers Receives its requests from the admin server through the console or Weblogic.admin Can be run automatically in the background, as a windows service or a Unix daemon
www.fandsindia.com
www.fandsindia.com
LETS DO IT
Server Status
Status of server can be monitored Server stdout can be viewed Starting all the servers in Domain Node Manager log files Using self-health with node manager
www.fandsindia.com
Self Health
Node manager can reboot failed server automatically No manual intervention required Health state is not visible through the console Can programmatically checked by JMX Configure using Console
www.fandsindia.com
Server Administration
What happens when admin server is down (managed Server independence) ? Console server tuning Replicating Domain config files Admin Server backup Discovery mode
For reconnecting to managed servers
www.fandsindia.com
Network Channels
A startup class is loaded and executed when Weblogic server boots Used to
Initialize objects in memory Modify JNDI tree Load critical values from database
Connector Modules
www.fandsindia.com
Clustering
Clustering
Concepts Hardware Load Balancers Web Server Plugins WLS J2EE Clustering
www.fandsindia.com
Concepts
A cluster is a collection of entities coordinating actions to provide scalable and highlyavailable services.
Scalable services
Add and remove servers as needed Load balance requests Concentrate communication
Support
Support
www.fandsindia.com
Cluster Architecture
www.fandsindia.com
Cluster Architecture
www.fandsindia.com
Stateless services
Choose any load balancing policy available No need for server affinity
Server Server Server Server Server Server
Load balancer
Server
Server
Application Servers
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
www.fandsindia.com
www.fandsindia.com
JS ES S
.js p
S JSE
N SIO
ID
9; D4 1 f =s
x.jsp e d /in
GE T /i
JSE SSI O
nde x.js p
www.fandsindia.com
N ID =a3 1Kz 0;
Multicast is used to
Derive cluster membership
Failure to receive 3 heartbeats mark server dead
Service advertisement
www.fandsindia.com
Stateful Services
HTTP Sessions Stateful session beans Entity Beans
JMS
www.fandsindia.com
www.fandsindia.com
http://dev2dev.bea.com/codelibrary/code/openb sd_lb.jsp
www.fandsindia.com
Every 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
Prior 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
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
Make your EJBs 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
Algorithms
Round robin Random Weight Server Affinity
www.fandsindia.com
The server affinity algorithms consider existing connections between an external Java client and server instances in balancing the client load among WebLogic server instances In the case of failure, causes the client to failover to a server instance to which it has an open connection
www.fandsindia.com
Scales well Easy to provide multiple instances of the same service Easy to provide load balancing and failover The methods on stateless session bean home are marked idempotent weblogic.ejbc compiler
www.fandsindia.com
Pinned to one server May be replicated to improve fault-tolerance May lose some or all state in unusual failures If using replication, idempotent methods improve availability
www.fandsindia.com
Use Optimistic Caching for EJBs When appropriate use read-only beans
EJBC tags all methods as idempotent
www.fandsindia.com
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 cluster setAttribute(), removeAttribute() trigger state replication Pros:
Scales really well Reliable
Cons
Might lose state
www.fandsindia.com
Configuration Aspects
Replication Groups Assign server to machine
LETS DO IT
Day 5
Monitoring (Application, Server) SNMP JMX Config and Runtime MBeans Backup and Restore Performance Tuning
www.fandsindia.com
Connection Pools JMS Applications Domain Cluster Reading and filtering log JRockit
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
www.fandsindia.com
Restarting Servers
Admin Managed
www.fandsindia.com
Performance Tuning
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 Testing
Test the application for concurrent request loads
Stress Testing
Test systems limits E.g. max concurrent users, max data volume
Performance Testing
www.fandsindia.com
Benchmark
A benchmark is a performance measurement of a system meant for use in comparisons Benchmark should be as realistic as possible
Database access Test environment similar to production environment
www.fandsindia.com
Steps
Preparing a metrics Reporting the results in predefined, well-planned, tabular format Store it in the database Methodologies
www.fandsindia.com
Methodology
www.fandsindia.com
Tools
www.fandsindia.com
www.fandsindia.com
Windows
Windows Task Manager Windows Performance Monitor
Unix
sar Mpstat Vmstat,Netstat,Iostat
www.fandsindia.com
The Grinder
Typical general purpose load testing Open Source Installing and load testing grinder See example
www.fandsindia.com
JVM tuning
Parameters
-ms384m -mx400m
QUESTION / ANSWERS
www.fandsindia.com
THANKING YOU !
www.fandsindia.com