# Tomcat 6 Clustering question



## TechOz (Jul 19, 2010)

Hi,
I am looking to install a Tomcat 6 on 2 servers and configure clustering between them to maintain session state. From the apache website they state there are 3 ways to achieve this as follows : 

1. Using session persistence, and saving the session to a shared file system (PersistenceManager + FileStore)
2. Using session persistence, and saving the session to a shared database (PersistenceManager + JDBCStore)
3. Using in-memory-replication, using the SimpleTcpCluster that ships with Tomcat 6 (lib/catalina-tribes.jar + lib/catalina-ha.jar)

My question is which is the most commonly used and of course most practical ?? 

Does option 1 require a clustered filesystem to write to, I am guessing so ???

If you use option 2, the database option, does the data remain in the DB and you have to clean it up yourself ????

If you use the option 3, how much memory is required and is there a way of calculating required memory ???

Any help on this will be appreciated.

Cheers
Jeff


----------



## Laxer (Dec 28, 2010)

Hi Jeff,

I would probably go with the second option...

Storing the information in a SQL DB would be quiet easy...

SQL is fast and small making clearing the DB not much of an issue...

Even if you do feel like cleaning it up all you would have to do is manually drop the table.I am not personally a fan of #1 and I have never tried #3 so I don't know if there is a way to figure out how much resources are needed.


----------



## TechOz (Jul 19, 2010)

Thanks for the reply,
Also wondering about tomcat 6 clustering, I am trying to find some info on how to configure clustering without using multicasting, any help on this would be appreciated.

Cheers
Jeff


----------

