JBoss EAP6 Overview

Exclusive offer: get 50% off this eBook here
JBoss EAP6 High Availability

JBoss EAP6 High Availability — Save 50%

Leverage the power of JBoss EAP6 to successfully build high-availability clusters quickly and efficiently with this book and ebook

$23.99    $12.00
by Weinan Li | December 2013 | Open Source

In this article from JBoss EAP6 High Availability, by Weinan Li, we will learn the basic concepts about high availability and have an overview of the functions that JBoss EAP6 provides to us in this field. And at the end have an overall better understanding JBoss EAP6.

(For more resources related to this topic, see here.)

Understanding high availability

To understand the term high availability, here is its definition from Wikipedia:

"High availability is a system design approach and associated service implementation that ensures that a prearranged level of operational performance will be met during a contractual measurement period. Users want their systems, for example, hospitals, production computers, and the electrical grid to be ready to serve them at all times. If a user cannot access the system, it is said to be unavailable."

In the IT field, when we mention the words "high availability", we usually think of the uptime of the server, and technologies such as clustering and load balancing can be used to achieve this.

Clustering means to use multiple servers to form a group. From their perspective, users see the cluster as a single entity and access it as if it's just a single point. The following figure shows the structure of a cluster:

To achieve the previously mentioned goal, we usually use a controller of the cluster, called load balancer, to sit in front of the cluster. Its job is to receive and dispatch user requests to a node inside the cluster, and the node will do the real work of processing the user requests. After the node processes the user request, the response will be sent to the load balancer, and the load balancer will send it back to the users. The following figure shows the workflow:

 

 

Besides load balancing user requests, the clustering system can also do failover inside itself.

Failover means when a node has crashed, the load balancer can switch to other running nodes to process user requests.

In a cluster, some nodes may fail during runtime. If this happens, the requests to the failed nodes should be redirected to the healthy nodes. The process is shown in the following figure:

To make failover possible, the node in a cluster should be able to replicate user data from one to another.

In JBoss EAP6, the Infinispan module, which is a data-grid solution provided by the JBoss community, does the web session replication.

If one node fails, the user request could be redirected to another node; however, the session with the user won't be lost. The following figure illustrates failover:

To achieve the previously mentioned goals, the JBoss community has provided us a powerful set of tools. In the next section we'll have an overview on it.

JBoss EAP6 high availability

As a Java EE application server, JBoss EAP6 uses modules coming from different open source projects:

  • Web server (JBossWeb)
  • EJB (JBoss EJB3)
  • Web service (JBossWS/RESTEasy)
  • Messaging (HornetQ)
  • JPA and transaction management (Hibernate/Narayana)

As we can see, JBoss EAP6 uses many more open source projects, and each part may have its own consideration to achieve the goal of high availability. Now let's have a brief on these parts with respect to high availability:

JBoss Web, Apache httpd, mod_jk, and mod_cluster

The clustering for a web server may be the most popular topic and is well understood by the majority. There are a lot of good solutions in the market.

For JBoss EAP6, the solution it adopted is to use Apache httpd as the load balancer. httpd will dispatch the user requests to the EAP server. Red Hat has led two open source projects to work with httpd, which are called mod_jk and mod_cluster. In this article we'll learn how to use these two projects.

EJB session bean

JBoss EAP6 has provided the @org.jboss.ejb3.annotation.Clustered annotation that we can use on both the @Stateless and @Stateful session beans.

The clustered annotation is JBoss EAP6/WildFly specific implementation.

When using @Clustered with @Stateless, the session bean can be load balanced; and when @Clustered is used with the @Stateful bean, the state of the bean will be replicated in the cluster.

JBossWS and RESTEasy

JBoss EAP6 provides two web service solutions out of the box. One is JBossWS and the other is RESTEasy. JBossWS is a web service framework that implements the JAX-WS specification. RESTEasy is an implementation of the JAX-RS specification to help you to build RESTFul web services.

HornetQ

HornetQ is a high-performance messaging system provided by the JBoss community. The messaging system is designed to be asynchronous and has its own consideration on load balancing and failover.

Hibernate and Narayana

In the database and transaction management field, high availability is a huge topic. For example, each database vendor may have their own solutions on load balancing the database queries. For example, PostgreSQL has some open source solutions, for example, Slony and pgpool, which can let us replicate the database from master to slave and which distributes the user queries to different database nodes in a cluster.

In the ORM layer, Hibernate also has projects such as Hibernate Shards that can deploy a data base in a distributed way.

JGroups and JBoss Remoting

JGroups and JBoss Remoting are the cornerstone of JBoss EAP6 clustering features, which enable it to support high availability. JGroups is a reliable communication system based on IP multicasting.

JGroups is not limited to multicast and can use TCP too.

JBoss Remoting is the underlying communication framework for multiple parts in JBoss EAP6.

Summary

In this article we learned the basic concepts about high availability and also had an overview of the basic functions of JBoss EAP6. This will help you in understanding JBoss EAP6 in a better way.

Resources for Article:


Further resources on this subject:


JBoss EAP6 High Availability Leverage the power of JBoss EAP6 to successfully build high-availability clusters quickly and efficiently with this book and ebook
Published: December 2013
eBook Price: $23.99
Book Price: $39.99
See more
Select your format and quantity:

About the Author :


Weinan Li

Weinan Li started off as a Metro Railway Engineer and has worked at Alcatel since 2004 playing with hardware and assembly language.

He entered Red Hat in 2011 and is currently working as a Senior Software Engineer in the JBoss EAP team. He is also the productization leader of JBoss EWS and an active contributor to RESTEasy.

He currently lives in Beijing with his wife and their three-year-old son.

Books From Packt


JBoss AS 5 Development
JBoss AS 5 Development

JBoss ESB Beginner’s Guide
JBoss ESB Beginner’s Guide

JBoss Tools 3 Developers Guide
JBoss Tools 3 Developers Guide

JBoss Weld CDI for Java Platform
JBoss Weld CDI for Java Platform

Business Process Management with JBoss jBPM
Business Process Management with JBoss jBPM

JBoss Portal Server Development
JBoss Portal Server Development

JBoss AS 5 Performance Tuning
JBoss AS 5 Performance Tuning

JBoss AS 7 Configuration, Deployment and Administration
JBoss AS 7 Configuration, Deployment and Administration


No votes yet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
F
t
V
q
U
j
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software