Chapter 9. Clustering in Tomcat 7

I would like to start this topic with a story. There were two teams; A and B, in an IT organization, managing different systems. Both teams consisted of highly qualified experts in middleware. One day, the CEO of that organization called a meeting for both teams, stating that they had to manage two different middleware environments, one middleware environment was individually assigned to teams A and B. Each team had to follow their own approaches to fix the environmental issues. After 3 months, each client performed a process review and the results surprised the higher management. Team A had maintained 50 percent uptime for the application and Team B had maintained 99 percent uptime for the application hosted in their environment. While comparing the approaches followed by each team, it was found that Team B had followed a high availability architecture using clustering while Team A had followed a single-server architecture.

In mid-year, the management announced the financial appraisal; Team A received no appraisal and, on the contrary, Team B members received high bonuses with promotions. Today, it's your chance to decide whether you want to join Team A or B. If you want to join Team B and follow a high availability architecture, read this chapter carefully.

In this chapter, we discuss:

  • High availability architecture and its advantages
  • Different types of high availability architectures including load balancing and clustering
  • Approaches used by IT industries while building a high availability architecture in an enterprise setup
  • How to do Apache Tomcat clustering
  • Various clustering architectures
  • How to solve common problems in clustering

What is a cluster?

The cluster is a group of servers or computers connected together, which may perform similar functionality in the system. These systems are normally connected to each other through high speed Ethernet. Cluster systems are used where quick processing or system availability is required. Some of the examples where clusters are highly used are the financial sector, banking, security areas, and so on. The following figure shows the J2EE containers clustered in the environment:

What is a cluster?

Note

Cluster topology varies from environment to environment, based on the application requirements.

Benefits of clustering

There are many advantages of clustering in a middleware environment. It also depends on which cluster techniques we are using. We will discuss the various advantages of clustering:

  • Scalability: It gives freedom to the system architect to accommodate future enhancements for applications and servers. Suppose the web application currently has 100 concurrent users, and at the time of an event, you are expecting 500 concurrent users. What would you do to make sure that the system runs as expected? Clustering is one of the best solutions.
  • High availability: High availability systems are implemented in environments that need to be up 99.99 percent, such as banking, financial sectors, and so on where entire transactions need to be recorded on the systems. They cannot afford to have their websites down for a minute. Hence, they implement a high availability system to make sure the system will not be down at any time.
  • High performance: One of the major advantages of clustering is that it boosts up the system performance by n times where, n = number of systems. For example, if you are running the system with a single server and the system supports 100 concurrent users, then just by adding another server system you can support 200 concurrent users. Also, if you want to decrease the response time for the application, you can use the JVM performance tuning.
  • Cloud computing: Clustering is also very useful in a cloud computing environment. It is used while setting the grid computing architecture for cloud computing to improve performance.

Disadvantages of clustering

Until now, we have discussed how useful clustering is for a web environment. Let's discuss the disadvantages of clustering:

  • Cost: It plays a major role in the implementation of a new environment. If we want to setup web clustering, then we need more servers. This, again, increases the cost of the project.
  • Monitoring: With an increase in the number of servers, the monitoring of servers will also increase, making it difficult for the web administrator to manage the servers.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.19.29.89