If you have two tomcat working in a cluster (behind a load balancer or behind Apache), it is very simple.
- Take server 1 from the cluster, upgrade it.
- Return server 1.
- Take server 2 from the cluster, upgrade it.
- Return server 2.
Everything else will lead to downtime (albeit brief) if you are doing a complete redistribution of your application.
If you can put up with a short downtime (<1 s), you can emulate this by deploying to the second tomcat instance, and then point your load balancer to the second instance. In this case, you will lose any active sessions, but the switch should be quick.
In both cases, there are problems with database synchronization, which you will have to solve.
source share