Cluster technology is a very popular method to improve the system service capability and high reliability (Ha-high availability). By combining multiple independent servers into one cluster, failure can be seamlessly transferred. That is to say, when a server in a cluster becomes a machine, the user status data on it can be seamlessly migrated to other servers in the cluster. In this way, the customers who are using the application can completely feel the impact, greatly providing system reliability.
Clusters have many types and layers, such as operating system clusters (such as Linux and Solaris), Database clusters (such as DB2 and Oracle ), application Server Clusters (such as glassfish and WebLogic) and web clusters (such as Tomcat ). This tutorial will introduce you to the web clusters created by Tomcat.
No matter what technology the cluster is built on, its basic composition is shown in:
It can be seen that each cluster requires a Server Load balancer, which is responsible for distributing requests sent from outside to the cluster evenly to every server in the cluster according to certain algorithms, balance the load of all servers in the cluster as much as possible. For external clients, they do not know which server in the cluster is accessed. multiple servers can be regarded as a "large" server logically. In this way, when the service capabilities of the cluster cannot meet the current needs, it is very convenient to add new servers to the cluster to meet the needs. It can be seen that the system has excellent scalability after the cluster is used. When a server suddenly becomes a machine in the cluster, its user status data can be migrated to other servers without affecting the use of online users. In this way, the cluster technology can be used to conveniently achieve high system reliability.
This article describes the structure of a Web Cluster built using Tomcat:
The server Load balancer of the cluster is composed of open-source Apache servers. The web servers in the cluster are composed of two Tomcat servers, and the backend database server is composed of one MySQL server.
Tomcat Load Balancing Principle detailed explanation and configuration: http://www.cnblogs.com/dcba1112/archive/2011/08/01/2124092.html