Tomcat primary secondary setup in multiple AWS EC2 instances

I have got a java application war file deployed inside a tomcat (primary) server of an AWS EC2 instance. This war typically performs some backend tasks and does NOT directly interact with any end users. I have created a similar tomcat (secondary) server inside another EC2 instance and deployed the same war file.

How can I set up the primary & secondary tomcat instances such that the secondary EC2's tomcat can become active automatically incase if the primary EC2's tomcat goes down?

1 answer

  • answered 2020-12-02 13:39 Hiran Chaudhuri

    The issue not on Tomcat. You bring up multiple, and either they all act on their own or can even share session information when running as a cluster. This cluster targets an active/active setup.

    However unless your application is aware of that and supports that use case, your only option is to run one Tomcat including your war at a time. So you are searching for an active/passive setup and may need additional software as listed in implementations.