[英]Tomcat test and production environment
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?
在一台Tomcat服务器上部署多个tomcat实例或多个Web应用程序实例更好?
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. 如果一个服务器可以处理负载,我会说最好只有一个Tomcat实例并在必要时多次部署
web-app
。
This way: 这条路:
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. 例如,根据您的资源和团队规模,您有一个生产区域:Web服务器,数据库,邮件服务器。 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. 是的,这一切都很不方便,但从长远来看,它可以帮助你避免头痛。
The idea of deploying the same web-app several times in order to reduce administration burden is good. 多次部署同一Web应用程序以减轻管理负担的想法很好。
But in my opinion, this isn't an acceptable solution : suppose you deploy a web-app twice. 但是我认为这不是一个可以接受的解决方案:假设您两次部署了一个Web应用程序。 Once for a TEST environment and a second time for a PRODUCTION environment.
适用于TEST环境,第二次适用于PRODUCTION环境。 The web-app may encounter exceptions/errors (typically, memory-related issues) that may lead the whole Tomcat server to crash.
该Web应用程序可能会遇到异常/错误(通常是与内存相关的问题),可能导致整个Tomcat服务器崩溃。 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. 因此,我宁愿安装尽可能多的Tomcat实例作为不同的环境。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.