简体   繁体   English

Azure云服务 - VIP交换是否会导致OnStop()被调用?

[英]Azure cloud service - Does VIP swap cause OnStop() to be invoked?

I have an Azure cloud service with a web and a worker role. 我有一个带有Web和辅助角色的Azure云服务。 When an Azure cloud service is stopped, the OnStop() method is invoked. 停止Azure云服务时,将调用OnStop()方法。

On a VIP swap, does it call the same OnStop() method on the outgoing service deployment as soon as the VIP swap is requested? 在VIP交换上,一旦请求VIP交换,它是否在传出服务部署上调用相同的OnStop()方法? http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleentrypoint.onstop.aspx http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleentrypoint.onstop.aspx

Also, what is the order of events during the VIP swap? 此外,VIP交换期间的事件顺序是什么? Presumably, the worker OnStart() method of the new deployment is run at some point, but is this before the OnStop() of the outgoing deployment? 据推测,新部署的worker OnStart()方法在某些时候运行,但这是在传出部署的OnStop()之前吗? I am trying to understand whether the two worker role versions (incoming and outgoing deployment) will be running concurrently, or whether there will be a short gap in worker role service. 我试图了解两个工作者角色版本(传入和传出部署)是否将同时运行,或者工作者角色服务是否会有短暂的差距。

To the best of my knowledge, when you perform VIP swap changes happen at the router/firewall level and not at the cloud service level. 据我所知,当您执行VIP交换更改发生在路由器/防火墙级别而不是云服务级别。 Your cloud service keeps on running and OnStop() event is not fired. 您的云服务继续运行,并且不会触发OnStop()事件。 As mentioned in the documentation here: http://msdn.microsoft.com/en-us/library/windowsazure/hh386336.aspx 正如文档中所述: http//msdn.microsoft.com/en-us/library/windowsazure/hh386336.aspx

When the service is promoted to production, the VIP and URL that were assigned to the production environment are assigned to the deployment that is currently in the staging environment, thus “promoting” the service to production. 当服务升级到生产时,分配给生产环境的VIP和URL将分配给当前位于暂存环境中的部署,从而将服务“提升”到生产环境。 The VIP and URL assigned to the staging environment are assigned to the deployment that was in the production environment. 分配给登台环境的VIP和URL将分配给生产环境中的部署。

No events are fired during the "VIP swap". “VIP交换”期间不会触发任何事件。 We've added tracing for just all kind of events and entry points and definitely from the role code it looks like nothing happens during the "VIP swap". 我们已经为所有类型的事件和入口点添加了跟踪,并且肯定从角色代码中看起来在“VIP交换”期间没有发生任何事情。

You service will not be interrupted during the swap. 在交换期间,您的服务不会被中断。 Just new requests will start coming to the new deployment. 只是新请求将开始进入新部署。 The older and the newer deployments run in parallel until you stop the older (now staging) one. 旧的和较新的部署并行运行,直到您停止旧的(现在正在进行的)部署。 Your application should be able to handle this scenario and not break anything. 您的应用程序应该能够处理这种情况,而不是破坏任何东西。

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

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