简体   繁体   English

将ASP.NET网站版本投入生产(IIS)的最佳方法

[英]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应该向世界开放

  1. ARR_SITE listening on 80/443 with a binding of guestbook.com - this is where you will hang your re-write rules off of ARR_SITE使用guestbook.com绑定在80/443上侦听-这是您将重写规则挂起的地方
  2. Guestbook V5 listens on port 8080 with a binding of localhost/127.0.0.1 留言簿V5在端口8080上监听localhost / 127.0.0.1的绑定
  3. Guestbook V6 listens on port 1010 with a binding of localhost/127.0.0.1 留言簿V6在端口1010上监听localhost / 127.0.0.1的绑定

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.

相关问题 发布新版本的ASP.NET网站-最佳做法 - Release new version of ASP.NET website - Best Practices 在ASP.NET网站的ActiveDirectory中管理角色的最佳方法是什么? - What is the best way to manage roles in ActiveDirectory for ASP.NET Website? 在ASP.NET中控制大型网站上页面标题的最佳方法 - Best way to control page titles on a large website in ASP.NET asp.net网站可在localhost上运行,但不能在IIS上运行 - asp.net website working on localhost but not on IIS 在IIS中部署ASP.NET网站 - Deploying asp.net website in IIS IIS中对asp.net本地网站的权限 - permissions in IIS for asp.net local website 将ASP.NET MVC网站部署到IIS 8 - Deploy asp.net mvc website to iis 8 ASP.NET UDP套接字代码在开发中工作,但在IIS上不生产 - ASP.NET UDP socket code works in development, but not in production on IIS 在ASP.NET应用程序中以编程方式控制IIS 8.5和MSSQL的最佳方法 - Best Way to Programatically Control IIS 8.5 & MSSQL in an ASP.NET Application 什么是asp.net开发人员开发其现有网站的移动版本的最佳(简单和高效)解决方案 - What's the best (easy&efficient) solution for asp.net developers to develop a mobile version of their existing website
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM