Sun ONE Application Server, Enterprise Edition Getting Started Guide |
Chapter 1
Introduction to Sun ONE Application Server 7, Enterprise EditionThe following topics are included in this chapter:
About Sun ONE Application ServerThe Sun Open Net Environment (ONE) Application Server 7, Enterprise Edition provides a high-performance Java 2 Platform, Enterprise Edition (J2EE) platform suitable for broad deployment of application services and web services. It offers a new modular architecture based on industry standard components, including proven implementations of the HTTP server infrastructure, Java Message Service (JMS), and rigorous support of the latest J2EE and web services specifications with J2EE version 1.3, Java 2 Platform, Standard Edition version 1.4, and the Java APIs for XML (JAX) from the Java Web Services Developer Pack software. In addition, it offers clustering, load balancing, and HTTP session failover. For a complete list of features, see the Sun ONE Application Server Product Introduction.
Application server instances form the basis of an application server deployment. Each instance has its own directory structure, configuration, and deployed applications. Each server instance also includes the J2EE platform web and EJB containers. The Sun ONE Application Server also includes a proven, high-performance HTTP server. An Object Request Broker (ORB) module enables EJB invocation using RMI-IIOP.
To access backend systems, applications can leverage J2EE connector architecture support and third-party resource adapters, either the built-in JMS provider or third-party providers, and any combination of popular third-party JDBC drivers. Access to backend systems can be managed within the scope of distributed transactions using the built-in, all-Java Transaction Manager.
The Admin Server (also called the Administration Server) is a special server instance that runs the core administration application and an SNMP agent. All remote management activity flows through the Admin Server. Both command-line and web-browser -based administrative clients access the Admin Server directly either through HTTP, or securely through HTTPS.
Figure 1-1shows an application server instance in detail. The application server instance is a building block in the clustering, load balancing, and session persistence features described in "About Enterprise Edition Features".
Figure 1-1 Sun ONE Application Server Instance
Web server plug-ins (such as the load balancer plug-in) enable you to deploy the Application Server behind one or more web servers housed in a demilitarized zone (DMZ) that is bracketed by one or more layers of firewalls. The plug-ins provide a means for the front-end web server tier to direct incoming HTTP and HTTPS traffic received from the Internet to one or more Application Servers housed in a back-end application server tier.
A variety of client applications can access business services deployed to the Application Server. Web service clients and browser-based clients can use either HTTP or HTTPS to access the web services, server-side end points, and J2EE web applications.
Figure 1-1 shows a single administrative domain. Administrative domains enable you to define multiple, completely separate application server runtime configurations that reuse the same installation image. Each administrative domain has an Admin Server which in turn controls one or more application server instances. In the tutorials, you will be working with a single administrative domain configured during installation of the product, as well as multiple server instances in a cluster.
About Enterprise Edition FeaturesYou can group application server instances into clusters, and with a web server and a load balancer, provide load balancing and HTTP session persistence. This guide shows you how to use the Enterprise Edition features described in the following sections:
Clustering
A cluster is a group of application server instances that work together as one logical entity. Each application server instance in the cluster has the same configuration and the same applications deployed to it.
Using clusters in Sun ONE Application Server helps you to achieve:
- High availability by allowing for failover protection for the application server instances in a cluster. If one application server instance goes down, other application server instances take over the sessions that the unavailable server was serving. Sun ONE Application Server supports failover for HTTP sessions and EJB references within HTTP sessions.
- Scalability by allowing for the addition of application server instances to a cluster, thus increasing the capacity of the system. The load balancer of Sun ONE Application Server distributes requests to the healthy application server instances within the cluster. You can add more application server instances to a cluster without disrupting service.
The application server instances within a cluster can be hosted on different machines or on the same machine. That is, you can group application server instances across different machines into a cluster. For this guide, the default configuration is for two instances on the same machine.
For more information about clustering, see the Sun ONE Application Server Administrator’s Guide.
Load Balancing
The goal of load balancing is to evenly distribute the workload among multiple Sun ONE Application Server instances. You can use either the load balancer plug-in supplied with the Sun ONE Application Server, or you can use various third party hardware and software load balancers. This guide describes using the load balancer plug-in.
Sun ONE Application Server’s load balancer uses a sticky round robin algorithm to load balance incoming HTTP and HTTPS requests. When a new HTTP request is sent to the load balancer plug-in, the request is forwarded to an application server instance based on a simple round robin scheme. Subsequently, this request is “stuck” to this particular application server instance, either by using cookies or by explicit URL rewriting.
From the sticky information, the load balancer plug-in first determines the instance to which the request was previously forwarded. If that instance is found to be healthy, the load balancer plug-in forwards the request to that specific application server instance.
Because all requests for a given session are sent to the same application server instance, the session data can be cached on a single application server rather than having to be distributed to all instances in a cluster. This caching means that the sticky round robin scheme provides significant performance benefits that normally override the benefits of a more evenly distributed load that can be obtained with pure round robin.
For more information about load balancing, see the Sun ONE Application Server Administrator’s Guide.
Session Persistence
Session persistence ensures that if a Sun ONE Application Server instance or machine fails, the HTTP/HTTPS request will be picked up by another server. Sun ONE Application Sever supports persistence of HTTP sessions as well as failover of EJB references within HTTP sessions.
The high-availability database (HADB) is bundled with the Sun ONE Application Server as the persistence store to provide high availability for web applications. For more information on the high-availability database, see "High-Availability Database".
This section contains the following topics:
About Session Persistence Types
Sun ONE Application Server supports three types of persistence: ha, file, and memory.
- The ha persistence type stores the session information in the HADB. The ha persistence type is supported for production environments that require failover capabilities.
- The file persistence type stores session information periodically to files, but you may experience loss of data when an instance becomes unavailable. The file persistence type is not supported for production environments that require failover capabilities; however it is sometimes used in development environments for testing applications.
- The memory persistence type stores session information in a file in cases of graceful shutdown of the server instance. It does not store session information for unexpected shutdown. The memory persistence type is not supported for production environments that require failover capabilities.
The ha session persistence is the only type covered in the exercises in this guide. For more information on configuring and using the other types of session persistence, see the Sun ONE Application Server Administrator’s Guide.
About Session Persistence Configuration
When you install the Sun ONE Application Server and run the clsetup command, your session persistence information is configured to default values. However, you can change the default values to balance your particular needs for performance, reliability, and high availability.
For example, every time your data is saved, you can store the entire session, or you can store the session only if the session has been modified. Or, you can also configure the persistence setting so that only the modified attributes of the session are stored.
Similarly, you can choose the persistence frequency. For example, you can choose to store the session after every web request, thus providing high availability and reliability of updated session states, or you can choose to store the session after a time interval you specify, thus providing better performance.
For more information about the various configuration options for session persistence, see the Sun ONE Application Server Administrator’s Guide.
About Single Sign-on Session Information
In a single application server instance, once you are authenticated by a web application, you are not required to reauthenticate individually to other web applications running on the same instance. This is called single sign-on.
In order for this feature to continue to work even when a session fails over to another instance in a cluster, single sign-on information must be persisted to the HADB. This persistence is enabled when you enable high availability for the application server instance. High-availability is automatically configured when you run the clsetup command.
High-Availability Database
The high-availability database (HADB) is used to store session information so that HTTP sessions can persist. High availability means that the system remains available despite unplanned outages caused by hardware or software failures. The HADB, a JDBC-compliant database, is based on the Always-On technology. The HADB is capable of exceeding 99.999% data availability and offers an ideal platform for delivering all types of HTTP session state persistence within a highly-loaded enterprise application server environment.
The HADB achieves this data availability through fragmentation and replication of data. All tables in the database are partitioned to create subsets of approximately the same size called fragments. This process of fragmentation is based on a hash function that fragments and evenly distributes the data among the database’s nodes. Each fragment is stored twice in the database, in mirror nodes. This ensures fault tolerance and fast recovery of data. In addition, if a node fails or is shut down, a spare node can take over until the node is active again.
Without high-availability, when an unplanned outage occurs, the HTTP session state is lost during failover from one web container to another. Use of the HADB as the session persistence mechanism overcomes this situation. The HADB stores and retrieves all state information in a separate but tightly-integrated persistent storage tier.
Example Clustering Scenario
The following diagram shows a simple clustering scenario consisting of a web server with a load balancer plug-in, two Sun ONE Application Server instances configured to use the HADB to store HTTP session data, and a remote database management system (RDBMS) to store application data. Note that your actual operational deployment may vary. For example, you could use a third-party load balancer in place of the load balancer plug-in.
Figure 1-2 Example Clustering Scenario
The following steps describe how a request is serviced:
- An incoming client sends an HTTP request to a URL handled by the web server. The web server has been configured to allow the load balancer plug-in to handle the incoming HTTP request.
- The load balancer plug-in then forwards the request to one of the Sun ONE Application Server instances in the cluster. The plug-in uses sticky round-robin load balancing to determine the target instance.
- The target instance receives the request forwarded to it from the load balancer plug-in and begins an HTTP session, storing the HTTP session data to the HADB and the J2EE application data to the RDBMS. As the client progresses through the application, HTTP session data is updated and stored to the HADB and application data is updated in the RDBMS.
- If the instance fails due to a system crash, the load balancer detects that the instance has ceased responding to requests. When subsequent requests come it, the load balancer forwards them to a healthy instance in the cluster.
- The new target instance retrieves the failed over HTTP session information from the HADB and continues responding to the client’s requests, allowing the client to complete the HTTP session with no loss of session data.
For more information about deployment scenarios for the Sun ONE Application Server, see the Sun ONE Application Server System Deployment Guide.
Tools for Configuring and Administering the Application ServerSun ONE Application Server provides the following tools for configuring and administering the Sun ONE Application Server. You can use these tools to start and stop the server, as well as perform various other functions. Detailed steps for using some of these tools to perform specific configuration tasks are included in the tutorials.
- The asadmin utility. The asadmin utility is a command-line interface that you can use to perform administrative tasks on a single application server instance or administrative domain.
- The cladmin command. The cladmin command runs certain asadmin commands simultaneously on all application server instances in a cluster. Using the cladmin command assures you that all instances in the cluster are being configured identically, so you should use cladmin, rather than asadmin, whenever possible. Not all asadmin commands are supported by cladmin.
- The Administration interface. The Administration interface is a web-based user interface that you can use to configure the Admin Sever and individual application server instances. You can also use it to view the log files of individual application server instances.
- The clsetup command. The clsetup command allows you to easily set up a cluster, including initial configuration of the HADB database. For full instructions on the clsetup command, see the Sun ONE Application Server Installation Guide.