Tomcat – Is Tomcat Shared Session / Cluster between two machine possible

clustersessiontomcat

I have a setup of several Tomcat servers distributed between a few servers, all running the same thing. Apache is on top of Apache and a loadbalancer in front of the Apache servers. I want to cluster the Tomcats using Shared Session to minimize downtime and user interruption while deploying apps.

I know clustering works within the same server but is it possible to setup Tomcat in a way that it shares sessions between servers on different machines?

=> Server 1
==> Apache 1
===> Tomcat 1

=> Server 2
==> Apache 2
===> Tomcat 2

When Server/Tomcat 1 would be taken down, users and their sessions would transfer over to Server/Tomcat 2 and vice versa.

Best Answer

Take a look at Teracotta for web sessions.

Use Terracotta's fast, reliable web sessions plugin to get the scalability benefits of a stateless web architecture without overloading your database or rewriting your application. Terracotta for Sessions works with your favorite web framework and your own custom session objects.

The web sessions tutorial lists five simple steps for you to make in order to evaluate the product ( FOSS ).

Related Topic