在单个服务器中部署多个 Spring Boot Web 应用程序 [英] Deploying Multiple Spring Boot Web Applications in Single Server

查看:89
本文介绍了在单个服务器中部署多个 Spring Boot Web 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 5 个 Spring Boot Web 应用程序,但只有一个服务器(低端).

I have 5 Spring Boot web applications but have only one Server (low-end).

在一台服务器中部署所有 5 个服务器的最佳方法是什么?只有一个 Web 容器 (Tomcat) 并将它们作为单独的战争文件部署在同一个 Tomcat 上,还是在不同的 Tomcat 容器上运行所有 5 个(Spring Boot 默认行为)?

What is the best way to deploy all 5 in one Server? Having only one web container (Tomcat) and deploy all of them as separate war files on the same Tomcat or run all 5 on different Tomcat containers (Spring Boot default behavior)?

考虑到性能和可维护性,您有什么建议?

What is your recommendation by considering performance and maintenanability?

推荐答案

如果您的服务器上的资源很少,您就没有太多选择.每个 Java 虚拟机都有很大的开销,因此运行单独的容器将使您更早地达到低端服务器的极限.

If you have little resources on your server, you don't have much choice. Each Java virtual machine has a significant overhead, so running separate containers will make you reach the limits of your low-end server earlier.

您必须在具有不同 servlet 上下文的同一个 tomcat 服务器中部署您的战争.

You will have to deploy your wars in the same tomcat server, with different servlet contexts.

但是,如果您有足够的 RAM,我认为最干净的方法是创建 docker 镜像并在每个容器中运行独立的 spring-boot jar.

However, if you have sufficient RAM, the cleanest way in my opinion is creating docker images and running the standalone spring-boot jars in each container.

这篇关于在单个服务器中部署多个 Spring Boot Web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆