简体   繁体   English

Tomcat 多个 AWS EC2 实例中的主要辅助设置

[英]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.我有一个 java 应用程序 war 文件部署在 AWS EC2 实例的 tomcat(主)服务器中。 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.我在另一个 EC2 实例中创建了一个类似的 tomcat(辅助)服务器并部署了相同的 war 文件。

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?如果主 EC2 的 tomcat 出现故障,我如何设置主要和辅助 tomcat 实例,以便辅助 EC2 的 tomcat 可以自动激活?

The issue not on Tomcat.该问题不在 Tomcat 上。 You bring up multiple, and either they all act on their own or can even share session information when running as a cluster .您提出了多个,它们要么全部独立运行,要么在作为集群运行时甚至可以共享 session 信息。 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.但是,除非您的应用程序意识到这一点并支持该用例,否则您唯一的选择是一次运行一个 Tomcat,包括您的战争。 So you are searching for an active/passive setup and may need additional software as listed in implementations .因此,您正在搜索主动/被动设置,并且可能需要实施中列出的其他软件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM