How to deploy an ASP.NET Application with zero downtime

后端 未结 11 1352
日久生厌
日久生厌 2020-11-28 00:38

To deploy a new version of our website we do the following:

  1. Zip up the new code, and upload it to the server.
  2. On the live server, delete all the live
11条回答
  •  时光取名叫无心
    2020-11-28 01:13

    I went through this recently and the solution I came up with was to have two sites set up in IIS and to switch between them.

    For my configuration, I had a web directory for each A and B site like this: c:\Intranet\Live A\Interface c:\Intranet\Live B\Interface

    In IIS, I have two identical sites (same ports, authentication etc) each with their own application pool. One of the sites is running (A) and the other is stopped (B). the live one also has the live host header.

    When it comes to deploy to live, I simply publish to the STOPPED site's location. Because I can access the B site using its port, I can pre-warm the site so the first user doesn't cause an application start. Then using a batch file I copy the live host header to B, stop A and start B.

提交回复
热议问题