VIP 交换和持久性 - VIP 什么时候被回收? [英] VIP Swaps and Persistence - when exactly do VIPs get recycled?

查看:18
本文介绍了VIP 交换和持久性 - VIP 什么时候被回收?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VIP 交换 + CNAME 比 IP 交换 + A 记录如何更好?

作为上述的延续 - 由于 我遇到的问题 Azure 中的 CNAME.

As a continuation from the above - I'm very close to reverting back to A records due to issues I'm having with CNAMEs in Azure.

来自 Azure 文档,它说:

但是请注意,因为 IP 地址的生命周期是关联的对于部署,重要的是不要删除您的部署,如果您需要 IP 地址才能保留.方便地,一个的 IP 地址给定的部署槽(生产或暂存)在使用时持久化Windows Azure 中的两种升级机制:VIP 交换和就地升级.

Note, however, because the lifetime of the IP address is associated with a deployment, it is important not to delete your deployment if you need the IP address to persist. Conveniently, the IP address of a given deployment slot (production or staging) is persisted when using the two upgrade mechanisms in Windows Azure: VIP swaps and in-place upgrades.

我有 myapp.cloudapp.net,当前指向 1.1.1.1 的 VIP.如果我想将应用程序的某个版本部署到 Staging,我将使用我的应用程序旋转 Staging 插槽,进行一些测试,然后通过 VIP 交换进行无缝升​​级.该应用程序现在将使用 2.2.2.2 - 但如果此时我再次进行 DNS 查找,myapp.cloudapp.net 的 A 记录仍将指向 1.1.1.1,因为VIP交换对DNS没有影响,对吧?

I have myapp.cloudapp.net, currently pointing to a VIP of 1.1.1.1. If I want to deploy a version of my application to Staging, I'll spin the Staging slot up with my application, do some testing, and then do a seamless upgrade via VIP swap. The application will now be using 2.2.2.2 - though if I do a DNS lookup again at this point, the A record for myapp.cloudapp.net will still point to 1.1.1.1, since VIP swaps have no impact on DNS, right?

如果是这样,那么当我终止临时部署以节省成本时会发生什么?1.1.1.12.2.2.2 会保留给我的服务吗?我希望如此,因为这意味着我可以始终将 A 记录点指向 1.1.1.1,通过分阶段部署依赖于它,而不必担心 CNAME 的麻烦.但这意味着这个答案是不正确的.

If so, then what happens when I kill my staging deployment to save cost? Will both 1.1.1.1 and 2.2.2.2 be reserved for my service? I hope so, because that means I can have my A record point to 1.1.1.1 all the time, depend on it through staging deployments, and not worry about CNAME hassles. But that means that this answer is incorrect.

如果不是,那么这意味着 VIP 交换确实对 DNS 记录有影响,对吗?否则,我将能够做到这一点:

If not, then this means that VIP swaps do have effects on DNS records, right? Otherwise, I would be able to do this:

  • 1.1.1.1 > 2.2.2.2,drop staging,1.1.1.1 被回收
  • 再次启动 staging,2.2.2.2 > 3.3.3.3,但 DNS A 记录仍然指向 myapp.cloudapp.net 的 1.1.1.1.

最后一点没有任何意义,所以要么 DNS 记录确实更新,要么 3.3.3.3 永远不会出现,并且 1.1.1.1 和 2.2.2.2 总是在一起,因为只要我的云服务没有被删除.

That last bit wouldn't make any sense, so either DNS records do get updated, or 3.3.3.3 never enters the picture, and 1.1.1.1 and 2.2.2.2 are always together, as long as my cloud service doesn't get deleted.

我对这件事很困惑 - 任何指导都会很棒.

I'm very confused with this matter - any guidance would be great.

更新 - 我刚刚用以下内容对此进行了测试:

UPDATE - I just tested this with the following:

CHECK DNS - get 1.1.1.1
READ PROD - get 1.1.1.1
DEPLOY STAGING
READ STAGING - get 2.2.2.2
VIP SWAP
READ PROD - get 1.1.1.1
READ STAGING - get 2.2.2.2
CHECK DNS - get 1.1.1.1
KILL STAGING DEPLOYMENT
READ PROD - get 1.1.1.1

所以看起来A 记录可以使用 - 即使在暂存/生产之间切换时,PROD VIP 保持不变,但部署被交换.删除暂存并重新部署暂存会获得一个新的辅助 VIP,但主要 VIP 确实保持不变.我会等到比我更可靠的人可以在这里发表意见,然后再将其作为答案发布.

So it appears that A records CAN be used - even when switching between staging / production, the PROD VIP stays the same, but the deployments get swapped. Dropping staging and re-deploying staging gets a new secondary VIP, but the primary VIP does stay constant. I'll wait until someone more reliable than me can chime in here before posting this as an answer.

推荐答案

VIP 交换不会改变您的公共 IP.也就是说,如果您将应用程序部署在 1.1.1.1 的 prod 插槽中,并将 beta 部署在 2.2.2.2 的暂存插槽中,即使 VIP 交换后,您的公共 IP 仍将是 1.1.1.1.这是因为 VIP 只是负载平衡配置的变化.您可以从 IP 为 2.2.2.2 的暂存槽(最初为 prod 槽)中安全地删除您的原始应用程序.

VIP swap will not change your public IP. That's saying, if you have your application deployed in prod slot with 1.1.1.1 and beta deployed in staging slot with 2.2.2.2, your public IP will still be 1.1.1.1 even after VIP swapped. This is because VIP is just a load balance configuration changing. You can safely delete your original application from the staging slot (originally prod slot) which the IP was 2.2.2.2.

希望这会有所帮助,

这篇关于VIP 交换和持久性 - VIP 什么时候被回收?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆