Terracotta and Tomcat Clustering - Page 一
Terracotta and Tomcat Clustering - Page 1原网址:http://javadrama.blogspot.com/2012/10/terracotta-an
Terracotta and Tomcat Clustering - Page 1
原网址:http://javadrama.blogspot.com/2012/10/terracotta-and-tomcat-clustering-page-1.htmlIn this tutorial we will learn a lot of stuff :)
- How to install Terracotta in an Active/Passive HA (High Availability) model.
- How to configure Tomcat 6.0 to store/retrieve sessions on Terracotta.
- How to install and configure Apache Web Server configure it to relay requests to Tomcat.
Why?i can do session replication using Tomcat built-in clustering module, so why do i use Terracotta?well, the Tomcat clustering works just perfect with major four?concerns:- Clients' sessions data are part of the Tomcat JVM instance.
- There is extra work for Tomcat to make sure that the sessions and its data are replicated among the cluster
- not suitable for larger cluster because of using?multicasting, imagine the network traffic generated by eight tomcat nodes replicating their sessions.
- You can't store an object which is not serializable.
So, moving this responsibility to Terracotta would help?eliminating those four concerns.
Our Final?architecture???it is really simple:?- Both Tomcats store/retrieve sessions on the active Terracotta server.
- Apache web server forwards requests to both Tomcats.
- If the active Terracotta fails the passive Terracotta will be the active.
Let's Digg inFirst things first! we need:- terracotta-3.7.0-installer.jar
- apache-tomcat-6.0.35
- mod_jk.so
- httpd-2.2.22
- JDK 1.6
My five servers built on a single windows 7 box as a POC, you should have no troubles with running the same example on Linux, only minor chages are needed.Install and Configure Terracottaopen a terminal and change the directory to the place where you downloaded terracotta-3.7.0-installer.jarthe important thing to note here is the servers node?- for each Terracotta server that will run in the cluster you need to define a server node.
- the server tag has three attributes: