简体   繁体   English

Tomcat测试和生产环境

[英]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: 这条路:

  1. You'll have only one server to take care of (secure, administer, backup). 您将只有一台服务器负责(安全,管理,备份)。
  2. You share hardware resources among applications (RAM, DISK, CPU) 您在应用程序之间共享硬件资源(RAM,磁盘,CPU)

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.

相关问题 生产/测试环境易问题 - Production/Test Environment easy question Symfony2测试数据库生产环境 - Symfony2 test database production environment 我想要一个沙盒测试环境,它始终是Production的精确副本 - I want a sandboxed test environment that is *always* an exact copy of Production 是否可以知道 flutter 应用程序是在生产环境还是在测试环境中运行? - Is it possible to know if a flutter app is running on Production or in a Test Environment? 如何测试Rails应用程序在生产环境中是否正常工作 - How to test that Rails application works correctly in the production environment Spring框架如何保证测试代码不在生产环境执行? - How does Spring framework guarantee that test code is not executed on production environment? 如何在测试环境中为Time类定义“解析”,而不是开发或生产? - How can 'parse' be undefined for Time class in test environment, but not development or production? 开发/质量保证/生产环境 - Development/QA/Production Environment PHP中的开发和生产环境 - Development and production environment in PHP 如何为apple iap 服务器到服务器通知设置测试和生产环境 - how to setup test and production environment for apple iap server-to-server notification
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM