[英]Best way to put a ASP.NET website version into production (IIS)
What are the best way to put a website into production to minimize the downtime due to initial compilation and initialization? 使网站投入生产以最大程度地减少因初始编译和初始化而导致的停机时间的最佳方法是什么?
I don't like the IIS 8 application initalization module because (to my understanding) it needs to change machine specific configurations (applicationHost.config), which I'm not able (and hate anyway) to do. 我不喜欢IIS 8应用程序初始化模块,因为(据我所知)它需要更改计算机特定的配置(applicationHost.config),而我却无法(也讨厌)这样做。
How big .net website proceed to put into production? .net网站有多大投入生产? Is there a ideal solution where the old version isn't disabled until the new version is fully up and ready to replace the old version.
是否有一个理想的解决方案,在新版本完全启动并准备好替换旧版本之前,不要禁用旧版本。
You need a cluster of two, can be set up with the ARR or NLB. 您需要两个群集,可以使用ARR或NLB进行设置。
Having two nodes of the cluster, you just disable one so that all the traffic goes to the other. 在群集中有两个节点,您只需禁用一个,以便所有流量都流向另一个。
Then you update the site on the disabled server and warm it up. 然后,您在禁用的服务器上更新站点并对其进行预热。 And then you just switch active nodes in the cluster so that all new requests start to hit the updated server instantly.
然后,您只需切换集群中的活动节点,以便所有新请求立即开始命中更新后的服务器。
Then you silently disable the other one, upgrade, warm up and enable in the cluster. 然后,您静默禁用另一个,在集群中升级,预热并启用。 The downtime is zero.
停机时间为零。 Also, having at least two nodes in a cluster is a basic way to support the failover scenario and should be considered a must-have for a reliable website.
同样,在群集中至少有两个节点是支持故障转移方案的基本方法,并且应该被认为是可靠网站的必备条件。
If you don't want to use a NLB or external load balancing service (which is best practice!) You you could probably get away with using ARR+ Re-write rules and multiple sites. 如果您不想使用NLB或外部负载平衡服务(这是最佳做法!),则可能可以避免使用ARR +重写规则和多个站点。 I don't advise this it's kind of hacky
我不建议这有点过分
For example assume you have 1 IIS server and an application called guestbook that lives at guestbook.com The current version in prod is 5 and you are ready to deploy 6 例如,假设您有1台IIS服务器和一个名为guestbook的应用程序,该应用程序位于guestbook.com上,则prod中的当前版本为5,并且您准备部署6
On the server have 3 sites Created. 在服务器上创建了3个站点。 Only 80 and 443 should be open to the world
只有80和443应该向世界开放
On the ARR_SITE create a URL_Rewrite rule that will rewrite everything coming into guestbook.com:80/ to 127.0.0.1:8080 (Guestbook V5) 在ARR_SITE上创建一个URL_Rewrite规则,该规则会将进入guestbook.com:80/的所有内容重写为127.0.0.1:8080(Guestbook V5)
Deploy guestbook V6 as a new site port 1010 with a binding of localhost/127.0.0.1. 将访客留言簿V6部署为新站点端口1010,并将其绑定为localhost / 127.0.0.1。
Access the new site once from a server that can reach it http://127.0.0.1:1010
. 从可以访问
http://127.0.0.1:1010
的服务器访问新站点一次。 This will Initialize your site. 这将初始化您的站点。 At this point the real world can't access it because ARR is re-writing everything to V5
此时,现实世界无法访问它,因为ARR正在将所有内容重写为V5
Now update your re-write rule to point to 127.0.0.1:1010(Guestbook V6) 现在更新您的重写规则,使其指向127.0.0.1:1010(Guestbook V6)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.