0

将网站投入生产以最大限度地减少由于初始编译和初始化导致的停机时间的最佳方法是什么?

我不喜欢 IIS 8 应用程序初始化模块,因为(据我了解)它需要更改机器特定的配置(applicationHost.config),而我无法(并且无论如何都讨厌)这样做。

多大的.net网站着手投产?是否有一个理想的解决方案,在新版本完全启动并准备好替换旧版本之前不禁用旧版本。

4

2 回答 2

4

You need a cluster of two, can be set up with the ARR or 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.

于 2013-10-02T18:17:30.137 回答
1

如果您不想使用 NLB 或外部负载平衡服务(这是最佳实践!),您可能会使用 ARR+ 重写规则和多个站点而侥幸。我不建议这样做,这有点骇人听闻

例如,假设您有 1 台 IIS 服务器和一个名为 guestbook 的应用程序,该应用程序位于 guestbook.com。prod 中的当前版本是 5,您已准备好部署 6

在服务器上创建了 3 个站点。只有80和443应该向世界开放

  1. ARR_SITE 在 80/443 上监听并绑定 guestbook.com - 这是您将重写规则挂起的地方
  2. Guestbook V5 监听端口 8080,绑定 localhost/127.0.0.1
  3. Guestbook V6 监听端口 1010,绑定 localhost/127.0.0.1

在 ARR_SITE 创建一个 URL_Rewrite 规则,它将所有进入guestbook.com:80/的内容重写 为 127.0.0.1:8080 (Guestbook V5)

将留言簿 V6 部署为具有 localhost/127.0.0.1 绑定的新站点端口 1010。

从可以访问新站点的服务器访问一次http://127.0.0.1:1010。这将初始化您的站点。此时现实世界无法访问它,因为 ARR 正在将所有内容重写到 V5

现在更新您的重写规则以指向 127.0.0.1:1010(Guestbook V6)

于 2013-10-03T03:11:24.593 回答