Springboot : Deploying multiple applications on the same server

标签 spring spring-boot web-deployment executable-jar

在同一服务器上部署多个 Springboot 应用程序的最佳策略是什么。

我应该为每个应用程序使用不同的端口吗?如果我有 50 个应用程序怎么办?使用 50 个不同的端口可以吗?在这种情况下,如果我想要一个通往外部世界的入口点,我应该在前面构建一个 Controller 应用程序,将请求路由到这 50 个应用程序。

有没有更好的方法。我不会在单个大型 WAR 部署中部署所有应用程序,同时需要一种更好的方法来使用单个端点路由传入调用。

最佳答案

如果您的服务器足够强大,可以处理这 50 个应用程序,那么您可以将每个应用程序放在单独的端口上。

将它们暴露给外界的常见方法是将 API Gateway 放在它们的前面 - Nginx 或 Spring Cloud Zuul 或基于 Spring Cloud Gateway 的应用程序都可以完成这项工作(取决于您需要的网关的复杂程度)。

关于Springboot : Deploying multiple applications on the same server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50265830/

相关文章:

java - Thymeleaf + Spring Security 集成

eclipse - java Servlet在tomcat eclipse上部署 - 需要引用

angularjs - 当我将带有 ExpressJs API 的 NodeJs 发布到服务器时,它得到 404

java - 多次执行存储过程

java - 获取xquery结果时出现异常

java - 部署一次脚本用于迁移 MongoDB 中的数据

angular - 部署/运行: local Express web-server and local client-side angular app that sends ajax requests to this local web-server

java - 无法解析其中包含 List 元素的 json

无法调用 Spring Boot @Controller,但 @RestController 有效

java - 带有 GAE 的 Spring Boot(旧版)- Autowiring