http://www.developer.com/

Back to article

Implementing Highly Available and Scalable Solutions Using the WebLogic Cluster


October 3, 2003


This material is from the book BEA WebLogic Platform 7 , written by by Jatinder Prem, Bernard Ciconte, Manish Devgan, Scott Dunbar, Peter Go, published by Sams Publishing.

© Copyright Sams Publishing. All rights reserved.


In This Article

  • The Motivations for Clustered Infrastructure Solutions: Scalability and High Availability
  • Understanding WebLogic Clusters
  • Understanding Which Objects Can Be Clustered

The Motivations for Clustered Infrastructure Solutions: Scalability and High Availability

Scalability and high availability (fault resilience) are two key infrastructure adaptability requirements that organizations must reflect in the architectural (system) design of their mission-critical e-business solutions. As illustrated in Figure 1, during the client/server era, scalability and high-availability solutions were primarily implemented in the Database or Server tiers, where

  • Databases were partitioned to provide scalability to the data architecture.

  • Data-centric business processing was migrated from the Client tier into the Database tier whenever feasible—for example, through the use of stored procedures, triggers, and packages in an Oracle database.

  • High availability was implemented in the Database tier through

  • Hardware and database software clustering solutions, which involved in-memory or file-system replication of data.

  • Hot-standby databases in conjunction with a robust and efficient backup and recovery solution.


Figure 1 Scalability and high availability within a client/server architecture.

To implement an agile and robust J2EE e-business solution, scalability and high availability solutions for the Database tier still remain applicable as they did for the client/server system, but now they address the Enterprise Information System (EIS) tier. However, as illustrated in Figure 2, scalability and high availability must now also be addressed at the distributed middle tiers of the J2EE Application Programming Model—the Presentation (Web servers) and Application (Application servers) tiers—which brings a whole new dimension of challenges. These challenges are as follows:

  • Any potential points of failure must be masked from system users through effective Web and J2EE server failover mechanisms, thus eradicating or minimizing an application's downtime.

  • Performance should not be compromised for scalability through the dynamic introduction of additional online Web and J2EE servers and hardware.

  • Scalability and high-availability solutions should not incur complex development or management efforts for realization.

  • The hardware and operating system portability of J2EE solutions should not be constrained through the mechanics of introducing scalability or high availability.


Figure 2
Scalability and high-availability requirements within the J2EE Application Programming Model.

Scalability and high availability within a J2EE architecture are achieved through the implementation of client-request load-balancing techniques in combination with the clustering capabilities of the J2EE application server that constitutes the middle tier, such as the BEA WebLogic Server cluster. A cluster cannot possess scalability or high availability without the support of an intelligent and robust load-balancing service.

A cluster in a J2EE architecture is generally defined as a group of two or more J2EE-compliant Web or application servers that closely cooperate with each other through transparent object replication mechanisms to ensure each server in the group presents the same content. Each server (node) in the cluster is identical in configuration and networked to act as a single virtual server. Client requests directed to this virtual server can be handled independently by any J2EE server in the cluster, which gives the impression of single entity representation of the hosted J2EE application in the cluster.

The following sections introduce the three highly interrelated core services—scalability, high availability, and load balancing—that any J2EE server clustering solution must provide.

How these services are implemented within WebLogic Server will be discussed later in this chapter.

Scalability

Scalability refers to the capability to expand the capacity of an application hosted on the middle tier without interruption or degradation of the Quality of Service (QoS) to an increasing number of users. As a rule, an application server must always be available to service requests from a client.

As you may have discovered through experience, however, if a single server becomes over-subscribed, a connecting client can experience a Denial of Service (DoS) or performance degradation. This could be caused by a computer's network interface, which has a built-in limit to the amount of information the server can distribute regardless of the processor's capability of higher throughput, or because the J2EE server is too busy servicing existing processing requests.

As client requests continue to increase, the J2EE server environment must be scaled accordingly. There are two approaches to scaling:

  • Forklift method—This method involves replacing the old server computer with a new, more robust and powerful server to host the J2EE server. The problem with this approach is that it is a short-term fix. As traffic continues to increase, the new computer will likely become obsolete, like the server it replaced.

  • Clusters—Clustering the J2EE servers makes it easy to dynamically increase the capacity of the cluster by just adding another node and updating the configuration of the load balancer to use the additional resource. Load balancers use a variety of algorithms to detect server request flows and monitor server loads to distribute server requests optimally across the cluster's nodes. Conversely, you can just as easily remove a node to scale down or replace a node during normal maintenance or upgrading.

By applying conventional wisdom, the most logical method for achieving scalability is though the implementation of a clustering solution.

High Availability

High availability refers to the capability to ensure applications hosted in the middle tier remain consistently accessible and operational to their clients.

High availability is achieved through the redundancy of multiple Web and application servers within the cluster and is implemented by the cluster's "failover" mechanisms. If an application component (an object) fails processing its task, the cluster's failover mechanism reroutes the task and any supporting information to a copy of the object on another server to continue the task. If you want to enable failover:

  • The same application components must be deployed to each server instance in the cluster.

  • The failover mechanism must be aware of the location and availability of the objects that comprise an application in a cluster.

  • The failover mechanism must be aware of the progress of all tasks so that the copy of a failed object can continue to complete a task where the processing last stopped without duplicating persistent data.

In the event of a failure to one of the J2EE servers in a cluster, the load-balancing service, in conjunction with the failover mechanism, should seamlessly reroute requests to other servers, thus preventing any interruption to the middle-tier service.

Additional Factors Affecting High Availability

In addition to application server clustering, which provides high availability in the middle tier of an application architecture, organizations must accept that people, processes, and the technology infrastructure are all interdependent facets of any high-availability solution. People and process issues comprise at least 80% of the solution, with the technology infrastructure assuming the remainder.

From a people and process perspective, the objective is to balance the potential business cost of incurring system unavailability with the cost of insuring against planned and unplanned system downtime. Planned downtime encompasses activities in which an administrator is aware beforehand that a resource will be unavailable and plans accordingly—for example, performing backup operations, making configuration changes, adding processing capacity, distributing software, and managing version control. Unplanned downtime, also known as outages or failures, includes a multitude of "What happens if" scenarios, such as

  • What happens if a disk drive or CPU fails?

  • What happens if power is lost to one or more servers by someone tripping over the power cord?

  • What happens if there is a network failure?

  • What happens if the key system administrator finds a better job?

In practice, organizations should initially focus on developing mature, planned downtime procedures before even considering unplanned downtime. This is supported through extensive studies conducted by research firms, which concluded that 70–90% of downtime may be directly associated with planned downtime activities. However, the organizational reality indicates that more time and effort are applied to preventing unplanned downtime.

From a technology infrastructure perspective, for a system to be truly highly available, redundancy must exist throughout the system. For example, a system must have the following:

  • Redundant and failover-capable firewalls

  • Redundant gateway routers

  • Redundant SAN switching infrastructure

  • Redundant and failover-capable load balancers/dispatchers

  • Redundant Enterprise Information System (EIS) layer, for example, content management systems, relational databases, and search engine systems

As stated earlier, the extent of redundancy should be directly related to the business cost of system unavailability versus the realized cost of insuring against system downtime.

Load Balancing

For a server cluster to achieve its high-availability, high-scalability, and high-performance potential, load balancing is required. Load balancing refers to the capability to optimally partition inbound client processing requests across all the J2EE servers that constitute a cluster based on factors such as capacity, availability, response time, current load, historical performance, and also administrative weights (priority) placed on the clustered servers.

A load balancer, which can be software or hardware based, sits between the Internet and the physical server cluster, also acting as a virtual server. As each client request arrives, the load balancer makes near-instantaneous intelligent decisions about the J2EE server best able to satisfy each incoming request. Software-based load balancers can come in the form of computers, routers, or switches with integrated load-balancing software or load-balancing capabilities. Hardware load balancers are separate pieces of equipment that provide advanced load-balancing features and additional reliability features such as automatic failover to a redundant unit.

Understanding WebLogic Clusters

In general terms, a WebLogic cluster is a group (two or more) of WebLogic Server instances (managed servers) that have been configured to share their resources, and through coordinated load balancing and replication mechanisms, the WebLogic cluster provides a very highly available and scalable execution environment for deployed J2EE Web and enterprise applications. An application deployed homogeneously to every server instance in a WebLogic cluster appears as a single instance of the application to a client, regardless whether the client is Web or Java based.

As illustrated in Figure 3, the administration server is responsible for configuring, managing, and monitoring all WebLogic Server instances (nonclustered and clustered) and resources in that domain. Because the administration server contains the configuration information for a WebLogic cluster, it must be available for connection to enable the clustered server instances to start up. When the clustered server instances are running, the availability of the administration server has no effect on the load-balancing and failover capabilities of the cluster. In a production environment, the administration server should not be configured as part of a WebLogic cluster because it must always be available for monitoring all other WebLogic instances and hence should not be overloaded with client requests.


Figure 3
A WebLogic environment consisting of clustered WebLogic Server instances.

From an administration perspective, each WebLogic cluster is managed as a single logical entity in the domain. For this reason, all WebLogic Server instances that constitute a cluster must reside in the same domain. Clusters cannot span across WebLogic domains.

Understanding Which Objects Can Be Clustered

For a clustering solution to be realized for both J2EE Web and enterprise applications, the WebLogic cluster provides scalability (via load balancing) and high-availability (via failover mechanisms) support for the following J2EE objects:

  • JavaServer Pages (JSPs) and servlets

  • Enterprise JavaBeans (EJBs)

  • Remote Method Invocation (RMI) objects

  • Java Messaging Service (JMS) factories

  • Java Database Connectivity (JDBC) connections


Note - File and Time services can be used within a cluster but cannot take advantage of any load-balancing or failover mechanisms.


The mechanisms the WebLogic cluster implements to ensure failover and load balancing for these objects vary in their implementation and are discussed in their respective sections later in this chapter.

Examining Deployment Restrictions to the WebLogic Cluster

The deployment restrictions differ between WebLogic Server 7 and WebLogic Server 7 SP1 (Service Pack 1) as follows:

  • WebLogic Server 7 SP1 allows the deployment of an application to a partial cluster, where all the clustered servers may not be reachable during the deployment process. As soon as the unreachable managed servers become available, the deployment process is reinitiated to these servers to complete the deployment process.

  • WebLogic Server 7 SP1 allows you to deploy a pinned service, such as an application to individual servers in a WebLogic cluster. However, because this type of deployment does not take full advantage of the load-balancing and failover capabilities of a WebLogic cluster, it is recommended you deploy such services to managed servers outside a WebLogic cluster.

Summary

Organizations have extremely high expectations for their mission-critical Web-enabled applications. They not only expect them to be up and running 24/7, but they also expect them to be scalable and transparently meet growing end-user demands. Meeting these requirements by leveraging larger, more powerful server machines is not only an expensive proposition, but can also be a short-lived solution that is prone to exhibiting signs of failure in the long term.

This article introduced the WebLogic cluster, which in conjunction with a load-balancing solution, is a far more cost-effective, flexible, and reliable solution for meeting the demands of highly available and scalable J2EE applications.

About the Authors

Jatinder Prem is the founder and the chief technology officer of ObjectMind Inc. (http://www.ObjectMind.com), a startup company focused on providing creative socio-technical solutions to organizations that need assistance in building J2EE enterprise solutions on the BEA WebLogic Platform. Educated at one of London's leading technology-focused universities, The City of London University, and maintaining professional certifications in Java Programming, Oracle, and Sybase Database Administration, Prem has more than 10 years of end-to-end software development experience, using a variety of methodologies and technologies with organizations such as Morgan Stanley, KPMG, Motability Finance, SMART Technologies, the Workers Compensation Board, and DuPont. Prem's other authoring successes include co-authoring the Oracle8 Bible and the custom Dev2Dev WebLogic Platform book provided to attendees at BEA eWorld 2003. Prem can be reached via e-mail through Prem@ObjectMind.com.

Bernard Ciconte is a software engineer for Blair Computing Systems, Inc. (BCSI). As an employee of BCSI since 1989, he has worked as a contractor for DuPont, Sterling Diagnostic Imaging, and Agfa Corporation. His technical expertise is in distributed computing and image processing for radiographical medical devices.

Manish Devgan is a Senior R&D Engineer with BEA Systems, where he is developing framework services for WebLogic Portal. At BEA, he has worked on WebLogic's Portal Entitlements Engine, Delegated Administration, Portal Administration Tools, and the end-to-end sample shipped with WebLogic Platform 7.

Scott Dunbar is an architect and senior software engineer for BEA Systems in Boulder, Colorado. At BEA he has been involved in several areas of the WebLogic Portal Server series, including e-commerce components, the entitlements subsystem, and partner integrations.

Peter Go is a senior software engineer with Mercury Interactive in Boulder, Colorado, where he is lead developer and strategist for Web Services APM (Application Performance Management) products.

Source of this material

This material is from Chapter 25: Implementing Highly Available and Scalable Solutions Using the WebLogic Cluster from the book BEA WebLogic Platform 7.0 (ISBN: 0-7897-2712-9) written by Jatinder Prem, Bernard Ciconte, Manish Devgan, Scott Dunbar, Peter Go, published by Sams Publishing.

To access the full Table of Contents for the book.


Other Chapters from Sams Publishing:

Web Services and Flows (WSFL)
Overview of JXTA
Introduction to EJBs
Processing Speech with Java
The Java Database Control in BEA Weblogic
Databases and Tomcat
Working with JAX-RPC
Understanding Servlets


Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date