简体   繁体   English

从负载平衡的Cloud Service删除Azure VM实例

[英]Delete Azure VM Instance from load balanced Cloud Service

I have 2 Azure vm's (Linux) being load balanced by a public Azure Cloud Service. 我有2个Azure虚拟机(Linux)由公共Azure云服务进行负载平衡。 Both instances show in the Azure Management portal for the same cloud service. 两个实例均在Azure管理门户中显示相同的云服务。 I want to take down one instance and perform some maintenance. 我想删除一个实例并执行一些维护。 However since the instance is still showing even though the VM has been shutdown it the Cloud Service is still directing traffic to it. 但是,由于即使VM已关闭,实例仍在显示,因此Cloud Service仍将流量定向到该实例。 How do I delete an instance from the Cloud Service or stop the Cloud Service from directing traffic to a particular VM instance? 如何从Cloud Service删除实例或停止Cloud Service将流量定向到特定VM实例? Then afterwards how does one re-associate an existing VM to that service? 然后,如何将现有的VM重新关联到该服务? (ie change from one Cloud Service to another). (即从一种云服务更改为另一种)。

Note: SSH works into the VM but other ports used by the VM are not working acting like they are trying to go to the other VM even though the correct endpoints are created to the active VM. 注意:SSH可在VM中使用,但即使已为活动VM创建了正确的端点,该VM所使用的其他端口也无法正常运行,就像它们试图转到其他VM一样。

The purpose of a port probe in a load-balanced set is for the load balancer to be able to detect whether or not a VM is able to accept traffic. 负载平衡集中的端口探针的目的是使负载平衡器能够检测VM是否能够接受流量。 When configuring the load-balanced endpoint you can specify a webpage or a TCP endpoint for the probe - and this should be present on each instance. 配置负载平衡端点时,您可以为探针指定网页或TCP端点-每个实例上都应存在该端点。 Traffic will be directed to the VM as long as the webpage returns 200 OK or the TCP endpoint accepts the connection when the load balancer probes. 只要网页返回200 OK或负载均衡器探测时TCP端点接受连接,流量就会被定向到VM。 You can specify the time interval between probes and the number of probes that must fail before the endpoint is deemed dead and should be taken out of rotation (defaults are every 15 seconds and 2 probes). 您可以指定两次探查之间的时间间隔,以及在端点被视为已失效之前必须失败并应撤消旋转的探查次数(默认为每15秒和2个探查)。

You can take a VM out of load-balancer rotation by ensuring that the configured probe page returns something other than 200 OK and then bring it back into rotation by having it once again send a 200 OK. 您可以通过确保已配置的探针页面返回200 OK以外的内容来使VM脱离负载均衡器旋转,然后再次发送200 OK使其返回旋转状态。

When I have needed to keep my webservice running and returning status of 200 I have had to resort to removing the endpoint from the load-balanced set. 当我需要保持我的Web服务运行并返回200状态时,我不得不诉诸于从负载平衡集中删除端点。 It is pretty simple to do but it does take usually a minute for the webPortal to remove the endpoint and then again once you recreate the endpoint to put it back in the set. 这非常简单,但是webPortal删除端点通常需要一分钟,然后在重新创建端点以将其放回集合中后,再次移除端点。

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

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