将 ASP.NET 部署到单个服务器而不中断服务
我有一个在单个服务器上运行的网站(因此没有负载平衡器)。当我使用 MSDeploy 进行部署时,虚拟目录中的所有文件都会被覆盖。当然,这是预期的。问题是,当 IIS 重置时,我的用户会被中断 15-30 秒左右。没什么大不了的,但是如果能做到0中断就更好了。我不认为这是可以避免的,但想检查一下 SO 上是否有人知道我不知道的事情
Possible Duplicate:
How Do I deploy an application to IIS while that web application is runningHow to deploy an ASP.NET Application with zero downtime
Publishing/uploading new DLL to IIS: website goes down whilst uploading
Is smooth deployment possible with componentized ASP.NET MVC apps?
I have a website that runs on a single server (so no load balancers). When I make a deployment using MSDeploy, all the files in my virtual directory get overwritten. This is expected, of course. The problem is that my users get interrupted for 15-30 seconds or so while IIS resets. Not a big deal, but it would be better if there were 0 interruption. I don't think this is avoidable, but wanted to check to see if anybody on SO knew something I didn't
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
顺便说一句,我在这里提到的方法:如何部署零停机时间的 ASP.NET 应用程序是我们在我的公司所遵循的方法,并且到目前为止对我们来说效果很好。我们开发了一个应用程序来帮助我们。
它与 Teamcity 集成,这是一个持续集成工具,可以告诉我们部署的进度并记录相同的信息。
btw the approach as I mentioned here: How to deploy an ASP.NET Application with zero downtime is the approach that even we follow at my company and it has worked out well for us till now. We have an app developed that aids us in the same..
Its integrated with Teamcity a continuous integration tool that tells us the progress of the deploy and logs the same.
如果您的代码或 web.config 发生更改,IIS 将重新启动应用程序。也许有办法解决这个问题,但所涉及的工作量将远远超过收益。
If your code or web.config was changed, IIS will restart the application. There may be a way around that, but the amount of work involved would far outweigh the benefits.
这是可行的,这只取决于您希望构建/部署的复杂程度。
例如,您可以:
应该说,我实际上还没有尝试过此操作,因此可能是当虚拟目录路径更改时,垃圾和 IIS 可能会重新启动站点。 ;-) 如果它确实有效,那么您唯一的停机时间将是重命名这两个目录所需的时间。
It is do-able, it just depends on how complicated you want your build/deploy to be.
For example you could:
It should be said that I haven't actually tried this so it might be rubbish and IIS may restart the site when the virtual directory path changes. ;-) If it does work, your only down time will be the time it takes to rename the two directories.