是否可以平滑地“热部署"部署?一个ASP.NET Core应用程序? [英] Is it possible to smoothly "hot deploy" an ASP.NET Core app?

查看:256
本文介绍了是否可以平滑地“热部署"部署?一个ASP.NET Core应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在带有.NET Framework的ASP.NET下,您可以执行新代码的热部署"而不会中断.之所以可行,是因为IIS可以为同一个应用程序处理多个应用程序域:当新代码到达时,它耗尽"了旧的应用程序域,允许它完成请求,同时新的应用程序域启动并开始服务新的请求.

Under ASP.NET with .NET Framework, you can perform a "hot deploy" of new code without disruption. This works because IIS can juggle multiple app domains for the same application: when new code arrives it "drain stops" the old app domain, allowing it to finish requests while simultaneously the new app domain starts up and starts serving new requests.

我的问题是:使用Kestrel的ASP.NET Core中有与此类似的东西吗?如果是这样,什么?

My question is: is there any parallel to this in ASP.NET Core with Kestrel? If so, what?

推荐答案

Kestrel不像IIS那样具有内置功能.考虑一下:Kestrel直接绑定到端口80.您必须启动一个新的Kestrel进程来更新代码.这些进程不能共享端口80,并且在没有反向代理的情况下,无法将端口从一个进程传递给另一个进程.

Kestrel doesn't have this built in like IIS does. Think about it: Kestrel binds directly to port 80. You have to start a new Kestrel process to update your code. Those processes can't share port 80 and there is no way to hand it off from one process to the other without a reverse proxy in front of both.

您可以在Web服务器之前使用负载平衡器.然后进行滚动更新或蓝绿色部署.

You could use a load balancer in front of your webservers. Then do a rolling update or a blue-green deployment.

这篇关于是否可以平滑地“热部署"部署?一个ASP.NET Core应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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