ASP.NET Core应用程序的多主机部署 [英] Multi-host deployment of ASP.NET Core applications

查看:115
本文介绍了ASP.NET Core应用程序的多主机部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑,因为我还没有看到任何有关如何使用HA和多主机部署来托管ASP.NET Core/.NET Core应用程序的博客或说明.所有示例均为:

I am quite confused as I haven't seen any blogs or instructions on how to host ASP.NET Core/.NET Core applications with HA and multi-host deployments. All examples are either:

1) One NGINX reverse-proxy, one Kestrel
2) One IIS reverse-proxy, one Kestrel

这两个组件都位于同一主机上.在实际的生产环境中,您可能拥有服务发现,多个前端,多个后端等LB.但是在这种情况下,没有任何说明.所以我的问题是针对多主机环境的:

And both components on same host. In real-life production environments, you have LB maybe service discovery, multiple frontends, multiple backends, etc. But for this case there are no instructions whatsoever. So my questions would be for multi-host environments:

  • 我是否将一个IIS/NGINX部署为LB/反向代理,并将请求重定向到在许多单独的VM(即各种不同的IP :)上运行的Kestrels?
  • 还是我要在一台主机上运行NGINX/F5进行负载平衡,然后将HTTP流量路由到运行IIS + Kestrel或仅Kestrel的各种VM:由于NGINX充当LB,因此在此设置中是否需要IIS?
  • 如果我以反向代理身份运行IIS或NGINX,它们可以在不同的VM上保持Kestrels处于活动状态吗,还是每个Kestrel是否仅需要一个IIS/NGINX使其保持活动状态?IE.Kestrel进程必须与反向代理位于同一主机上吗?

非常欢迎所有答案,并在此先多谢!:)

All answers are very welcome, and thanks a lot in advance! :)

推荐答案

我有一个安装程序,其中一个虚拟机使用(IIS作为LB)+多个虚拟机使用(IIS + Kestrel).对于我的用法来说,它工作正常,但是我很好奇其他人是否有不同的建议.然后,这取决于您在做什么,如果使用加密,则需要在VM之间共享机器密钥,您可能还需要在VM之间共享会话(

I have a setup with one VM using (IIS as LB) + several VMs with (IIS + Kestrel). It's working fine for my usage, but I'm curious to see if other people have different suggestions. Then it depends on what you are doing, if you use encryption, machine key needs to be shared between VMs, you might also needs to share session between VMs (https://www.exceptionnotfound.net/finding-and-using-asp-net-session-in-core-1-0/), store things in database ...

这篇关于ASP.NET Core应用程序的多主机部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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