简体   繁体   English

使用 Azure 负载均衡器进行持续交付

[英]Continuous Delivery with Azure Load Balancer

We have two VMs behind a Load Balancer.我们在负载均衡器后面有两个虚拟机。 We would like to make one of the VMs publicly inaccessible when we do a new deployment, so we can test the new version of the application before it becomes publicly accessible.我们希望在进行新部署时让其中一个虚拟机无法公开访问,这样我们就可以在应用程序的新版本公开访问之前对其进行测试。 The current plan is to block one out of two VMs by changing Network Security Group rule via Service Tag for Load Balancer:当前计划是通过负载均衡器的服务标签更改网络安全组规则来阻止两台虚拟机中的一台: 在此处输入图像描述

It works.有用。 When we change NSG Rule for VM1 from Allow to Deny only VM2 stays publicly accessible.当我们将 VM1 的 NSG 规则从允许更改为拒绝时,只有 VM2 保持可公开访问。 Once we verify that new release works as expected we then switch NSG rule for VM2 and switch NSG rule for VM1, so only a VM with the newest version of application is accessible while we update application on the other VM.一旦我们确认新版本按预期工作,我们就会为 VM2 切换 NSG 规则并为 VM1 切换 NSG 规则,因此在我们更新另一个 VM 上的应用程序时,只能访问具有最新版本应用程序的 VM。

The problem with that is NSG rules don't immediately take effect and can take 1-3 minutes to make VM inaccessible/accessible.问题在于 NSG 规则不会立即生效,并且可能需要 1-3 分钟才能使 VM 无法访问/可访问。 More over if we switch NSG for both VMs at the same time we can be in situations when both VMs with different version of software are publicly available which can lead to data corruption or data lose or both VM are not accessible.此外,如果我们同时为两个 VM 切换 NSG,我们可能会遇到两个具有不同软件版本的 VM 都公开可用的情况,这可能导致数据损坏或数据丢失,或者两个 VM 都无法访问。 So the only way around this is to change NSG rule for VM2 then for VM1 and having downtime of 2-6 minutes.因此,解决此问题的唯一方法是更改 VM2 的 NSG 规则,然后更改 VM1 的 NSG 规则,停机时间为 2-6 分钟。 Is there a better way to do that?有没有更好的方法来做到这一点?

Blocking ports 80 and 443 with Windows Defender Firewall via PowerShell Remoting brought the downtime to 40 seconds total.通过 PowerShell Remoting 使用 Windows Defender 防火墙阻止端口 80 和 443 使停机时间总计 40 秒。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM