如何部署零停机ASP.NET应用程序 [英] How to deploy an ASP.NET Application with zero downtime
问题描述
要部署我们的网站的新版本中,我们做到以下几点:
To deploy a new version of our website we do the following:
- 拉链拉上新的code,并把它上传到服务器。
- 在活的服务器,从IIS网站目录中删除所有活code。
- 提取新code压缩文件到现在空IIS目录
此过程是所有的脚本,并很快发生,但仍然可以是10-20秒的停机时间,当旧的文件被删除,并且新的文件被部署
This process is all scripted, and happens quite quickly, but there can still be a 10-20 second downtime when the old files are being deleted, and the new files being deployed.
在0秒停机时间的方法有什么建议?
Any suggestions on a 0 second downtime method?
推荐答案
您需要2服务器和负载平衡器。下面是步骤:
You need 2 servers and a load balancer. Here's in steps:
- 打开服务器2上的所有流量
- 部署在服务器1
- 测试服务器1
- 打开服务器1上的所有流量
- 部署在服务器2
- 测试服务器2
- 在两台服务器上打开交通
事情是,即使在这种情况下,你仍然有重新启动应用程序和会话的损失,如果您正在使用粘性会话。如果您有数据库会话或状态服务器,那么一切都应该罚款。
Thing is, even in this case you will still have application restarts and loss of sessions if you are using "sticky sessions". If you have database sessions or a state server, then everything should be fine.
这篇关于如何部署零停机ASP.NET应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!