【发布时间】:2018-02-22 00:09:03
【问题描述】:
使用服务关联关联方案,我有一个无状态的健康监控服务 (WatchdogService),它会定期 ping 我的 Timeservice 以检查健康状况。
应用程序清单定义了 TimeService 和 WatchdogService 之间的这种关联。
<DefaultServices>
<Service Name="WatchdogService">
<StatelessService ServiceTypeName="WatchdogServiceType" InstanceCount="[InstanceCount]">
<SingletonPartition />
<ServiceCorrelations>
<ServiceCorrelation ServiceName="fabric:/TimeServiceApplication/TimeService" Scheme="Affinity" />
</ServiceCorrelations>
</StatelessService>
</Service>
<Service Name="TimeService">
<StatelessService ServiceTypeName="TimeServiceType" InstanceCount="[InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
所以在 WatchdogService 中,我想检查同一节点中服务的运行状况。
目前我的服务是一个实例计数为 1 的单例,但如果我将其更改为 -1,我想确保 node1 上的 WatchdogService 实例检查 node1 上 TimeService 的运行状况。
有没有一种快速的方法可以在同一个节点上找到服务的实例,然后找到它的端点?
在 localhost:8088 行下方是我希望智能地使用我的托管服务的地方,因为此代码不适用于每个节点的实例。 https://github.com/tbertenshaw/FabricAllTheThings/blob/master/src/GuestApplication/WatchdogService/WatchdogService.cs
【问题讨论】:
标签: c# web-services azure-service-fabric