service - 在微服务架构中,微服务将如何服务?

标签 service deployment architecture port microservices

我已经阅读了一些文章并观看了一些视频,但在服务这些微服务方面没有找到具体的建议。我的理解是它们应该使用自己的应用程序服务器来提供服务。

我的问题是它们应该部署在不同的服务器上还是没关系。

当它们在同一台服务器(计算机)上提供服务时,不会出现端口冲突吗?

最佳答案

I have read some articles and watched some videos, but did not find a concrete suggestion when it comes to serving those micro-services. My understanding is that they should be served with their own application server.



这不是真的必要。 Play 和 Spray 等框架不需要应用服务器。

here - 我引用:

您也不会找到任何真正的基于微服务的架构托管在应用程序服务器中,这有点不合时宜。为此,微服务自托管,他们抓取一个端口并监听。这意味着您将失去典型企业应用程序服务器可能带来的任何好处,并且您的服务将需要提供一些更重要的功能(仪器、监控等)。

My question is should they be deployed on different servers or it does not matter.



您肯定希望共享服务器以节省硬件资源。容器化(参见例如 Docker 和 OpenShift)是一个很好的模型。

When they are served on the same server(computer) won't there be port conflicts?



如果您使用虚拟 IP 地址并绑定(bind)到 VIP,则不会。

或者,Docker 有不同的方法。它绑定(bind)到一个随机端口;然后您可以将该端口转发到该服务的“商定”端口上,以将其暴露给外界。

关于service - 在微服务架构中,微服务将如何服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20693516/

相关文章:

windows - 如何获取多线程Windows Service应用程序中正在运行的线程数

docker-compose 构建卡住。没有错误

node.js - 将 Node.js 应用程序部署到 Heroku 的 Sequelize 凭据

java - 广播接收器即使在应用程序被用户杀死后也能正常工作

java - NSIS - 在 x64 系统上检测 java 安装的问题

.net - 判断生产 Windows Server 上安装了哪个或哪些版本的 .NET 的万无一失的方法是什么?

c# - Team Foundation Server 是将 .net 网站自动发布到远程服务器的正确解决方案吗?

java - JSF2 : Open Session in View with EJBs?

rest - 我如何告诉我的前端后台作业已使用 Web 套接字完成?

python - 如何在我的代码中组织帮助函数