如何知道 Service Fabric 集群升级是否在微服务中完成

How to know if the Service Fabric cluster upgrade is done in a microservice

我需要做的是在整个集群升级完成后(在其中一个微服务中)做一些事情。

是否有任何事件或通知服务的东西?

您可以在其中任何一个的帮助下编写 'an event or something that notifies the services'。

  1. 您获得 Get Cluster Upgrade Progress 作为 Azure REST API。
  2. 如果你想使用 Azure Service Fabric Powershell 方式,你可以利用 Get-​Service​Fabric​Cluster​Upgrade

显然没有您想要的规定。举个例子,我在 Azure 服务结构集群中部署了一个应用程序。

outputwindow 中的部分回复是:

3>Started executing script 'Get-ServiceFabricApplicationStatus'.
3>[void](Connect-ServiceFabricCluster -TimeoutSec:10 -WarningAction:'SilentlyContinue' -ConnectionEndpoint:'sfcluster.southeastasia.cloudapp.azure.com:19000'); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModuleServiceFabricSDK\ServiceFabricSDK.psm1'; Get-ServiceFabricApplicationStatus -ApplicationName 'fabric:/SortApp' -ErrorAction Stop
3>The application has started.
3>Service Status:
3>fabric:/SortApp/SortService is ready.
3>
3>The application is ready.
3>Finished executing script 'Get-ServiceFabricApplicationStatus'.

这清楚地表明使用了 Get-ServiceFabricApplicationStatus 的脚本而不是 'an event or something that notifies the services'。