简体   繁体   English

托管一个以上基于tomcat的Web应用程序时的最佳实践是什么

[英]What is the best practice when hosting more then one tomcat based web application

I do understand that using the same tomcat instance for a number of web applications has some risks (eg if one web application crashes tomcat it will terminate the other web applications as well.). 我确实了解到,对于多个Web应用程序使用相同的tomcat实例存在一些风险(例如,如果一个Web应用程序使tomcat崩溃,它也会终止其他Web应用程序。)。 The benefit is of course cost effectiveness since one server is enough and having all the web applications in one place makes it very easy to administrate. 好处当然是成本效益,因为一台服务器就足够了,并且将所有Web应用程序放在一个位置使管理起来非常容易。

Are there any industry guidelines on how a good setup with multiple web applications on tomcat should look like? 是否有关于如何在tomcat上使用多个Web应用程序进行良好设置的行业准则?

Pros 优点

  • One JVM to monitor 一个要监视的JVM
  • Common libraries can be shared (sometimes risky) 可以共享公共库(有时有风险)

Cons 缺点

  • Common HTTP thread pool all applications are using (you can, however, configure several connectors with different thread pools) 所有应用程序正在使用的通用HTTP线程池(但是,您可以使用不同的线程池配置多个连接器)
  • One malfunctioning application can take down the whole server 一个出现故障的应用程序可能会导致整个服务器瘫痪
  • Restarting one application requires restarting all of them (if not using hot-deployment) 重新启动一个应用程序需要重新启动所有应用程序(如果不使用热部署)

You are right that hosting of multiple we applications on one application server / web container (either Tomcat or other) has benefits. 没错,在一个应用程序服务器/ Web容器(Tomcat或其他)上托管多个we应用程序是有好处的。

You mentioned the robustness issue when one application may cause failure of another. 您提到了一个应用程序可能导致另一个应用程序失败时的健壮性问题。 But let's simplify this: even if you have only one application you still want 24*7 availability. 但是让我们简化一下:即使只有一个应用程序,您仍然希望24 * 7的可用性。 To achieve this goal people typically run more than one instance of application server with identical application on each one and load balancer in the enterence to the site. 为了实现此目标,人们通常运行一个以上的应用程序服务器实例,每个实例上具有相同的应用程序,并在站点中负载均衡器。 The same is relevant for several web applications. 对于几个Web应用程序也是如此。 Just run N (2 as minimum) application servers with identical set of web applications deployed and load balancer. 只需运行N个(最少2个)应用服务器,并部署相同的Web应用程序集和负载均衡器即可。 You will probably need a kind of watchdog that restarts server if it failed or if it stopped responding etc. 如果服务器出现故障或停止响应等,您可能需要一种看门狗来重新启动服务器。

In some cases kind of clustering is required. 在某些情况下,需要某种群集。 But it is other story. 但这是另一个故事。

暂无
暂无

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

相关问题 什么是访问数据库的最佳基于Web的应用程序 - What is the best web based application to access a database 从.war文件恢复到Web应用程序的最佳做法是什么? - What is the best practice to recover from a .war file into a web application Java Web应用程序的目录结构的最佳实践是什么 - What is the best practice of the directory Structure Of Java Web Application 配置tomcat并托管Java Web应用程序 - Configuring tomcat and hosting a java web application 在Java Tomcat Web应用程序中存储加密密钥以对数据库中的敏感数据进行加密/解密的最佳实践是什么? - What's the best practice for storing encryption keys in a Java Tomcat web app for encrypting/decrypting sensitive data in a database? 创建基于角色的Web应用程序的最佳方法是什么? - What is the best approach to create a role based web application? 在基于多语言Java的Web应用程序中构建的最佳编码是什么,为什么? - What is the best encoding for buildin a multilingual java based web application, and why? 在基于Spring的Web应用程序中,在运行时控制对服务/屏幕访问的访问的最佳实践 - Best Practice to control access to service/screen access during run time in Spring based web application 在WEB API服务器和Android客户端应用程序之间共享模型的最佳实践是什么 - What is the best practice for sharing models between a WEB API server and an Android client application 获取在线Web服务应用程序的应用程序模块的最佳实践 - Best practice to get Application Module for Online Web Service application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM