将 ASP.NET 部署到单个服务器而不中断服务

发布于 2024-11-29 06:19:14 字数 874 浏览 1 评论 0原文

可能的重复:
如何部署在 Web 应用程序运行时将应用程序连接到 IIS

如何部署 ASP.NET 应用程序零停机

将新 DLL 发布/上传到 IIS :上传时网站崩溃了

组件化 ASP 是否可以顺利部署.NET MVC 应用程序?

我有一个在单个服务器上运行的网站(因此没有负载平衡器)。当我使用 MSDeploy 进行部署时,虚拟目录中的所有文件都会被覆盖。当然,这是预期的。问题是,当 IIS 重置时,我的用户会被中断 15-30 秒左右。没什么大不了的,但是如果能做到0中断就更好了。我不认为这是可以避免的,但想检查一下 SO 上是否有人知道我不知道的事情

Possible Duplicate:
How Do I deploy an application to IIS while that web application is running

How 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一笑百媚生 2024-12-06 06:19:14

顺便说一句,我在这里提到的方法:如何部署零停机时间的 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.

π浅易 2024-12-06 06:19:14

如果您的代码或 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.

葬花如无物 2024-12-06 06:19:14

这是可行的,这只取决于您希望构建/部署的复杂程度。

例如,您可以:

  • 将站点部署到新文件夹(即 sitename_deploy)
  • 在新文件夹中创建虚拟目录
  • 强制加载新站点(以便 IIS 启动该站点)
  • 重命名现有站点目录(即 sitename_old)
  • 重命名将新站点文件夹更改为正确的活动文件夹名称(即 sitename)
  • 删除旧站点(即 sitename_old)
  • 删除您在步骤 2 中创建的虚拟目录。

应该说,我实际上还没有尝试过此操作,因此可能是当虚拟目录路径更改时,垃圾和 IIS 可能会重新启动站点。 ;-) 如果它确实有效,那么您唯一的停机时间将是重命名这两个目录所需的时间。

It is do-able, it just depends on how complicated you want your build/deploy to be.

For example you could:

  • Deploy your site to a new folder (i.e. sitename_deploy)
  • Create a virtual directory to the new folder
  • Force a load of the new site (so that IIS starts up the site)
  • Rename your existing site directory (i.e. sitename_old)
  • Rename the new site folder to the correct live folder name (i.e. sitename)
  • Remove your old site (i.e. sitename_old)
  • Remove the virtual directory you created in step 2.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文