Tomcat测试和生产环境

发布于 2024-10-02 19:45:05 字数 79 浏览 4 评论 0原文

为一个网络应用程序提供多种环境的最佳设计是什么?在一台 Tomcat 服务器上部署多个 Tomcat 实例或多个 Web 应用程序实例哪个更好?

What is the best design to have many enviroments for one web-app? Is it better to have multiple tomcat instances or multiple web-app instances deployed on one Tomcat server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

〃温暖了心ぐ 2024-10-09 19:45:05

如果一台服务器可以处理负载,我认为最好只有一个 Tomcat 实例,并在必要时多次部署 web-app

这样:

  1. 您只需维护一台服务器(安全、管理、备份)。
  2. 您在应用程序之间共享硬件资源(RAM、磁盘、CPU)

If one server can handle the load, I would said it's better to have just one Tomcat instance and deploy web-app multiple times if necessary.

This way:

  1. You'll have only one server to take care of (secure, administer, backup).
  2. You share hardware resources among applications (RAM, DISK, CPU)
ぽ尐不点ル 2024-10-09 19:45:05

多次部署同一个 Web 应用程序以减轻管理负担的想法很好。

但在我看来,这不是一个可接受的解决方案:假设您部署一个网络应用程序两次。一次用于测试环境,第二次用于生产环境。 Web 应用程序可能会遇到异常/错误(通常是与内存相关的问题),这可能会导致整个 Tomcat 服务器崩溃。在这种情况下,一个环境中遇到的问题将导致另一个环境不可用。

因此,我宁愿根据不同的环境安装尽可能多的Tomcat实例。

The idea of deploying the same web-app several times in order to reduce administration burden is good.

But in my opinion, this isn't an acceptable solution : suppose you deploy a web-app twice. Once for a TEST environment and a second time for a PRODUCTION environment. The web-app may encounter exceptions/errors (typically, memory-related issues) that may lead the whole Tomcat server to crash. In such a situation, problems that were encountered in one environment would cause the other one to be unavailable.

Therefore, I would rather install as many Tomcat instances as different environment.

‘画卷フ 2024-10-09 19:45:05

理想情况下,您应该尽可能将所有生产代码保存在完全独立的环境中,以避免错误并出于安全原因。

根据您的资源和团队规模,例如,您有一个用于生产的飞地:Web 服务器、数据库、邮件服务器。这应该有规则禁止任何开发资源访问生产资源,反之亦然。如果您的开发资源受到损害或者您运行的脚本访问了错误的资源,那么就会有一层保护。

是的,这很不方便,但从长远来看,它可以让你免于头痛。

Ideally, you should keep all production code on a completely separate environment as much as possible just to avoid mistakes and for security reasons.

Depending on your resources and team size, say for example, you have an enclave for production: web server, database, mail server. This should have rules to disallow any development resources from access production resources and vice versa. If your dev resources have been compromised or you run a script going to the wrong resource, there would be a layer of protection for that.

Yes, this is all inconvenient, but it could save you from having big headaches in the long run.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文