JBoss EAP6 High Availability
上QQ阅读APP看书,第一时间看更新

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:

Understanding high availability

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:

Understanding high availability

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

Tip

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:

Understanding high availability

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

Tip

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:

Understanding high availability

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.