azure - 限制所有服务结构节点中的一个服务实例

标签 azure azure-service-fabric service-fabric-stateless

我有一个无状态服务结构服务,它基本上以指定的时间间隔进行批处理。因此,拥有多个实例会使事情变得复杂,因为每个实例都会尝试执行相同的批处理作业。

我严格要求运行单个批处理过程。目前我已在ApplicationManifest.xml 中将此服务的InstanceCount 设置为1。如果有多个节点会发生什么?我仍然拥有该服务的单个实例吗?或者如何确保该服务具有单个实例,无论节点/分区的数量如何?

最佳答案

Currently I have set the InstanceCount of this service to 1 in ApplicationManifest.xml. What will happen if there are multiple nodes? Would I still have single instance of this service?

如果有多个节点,则只有一个节点包含主事件实例。其他节点可能会托管在需要时接管的副本,例如当主实例所在的节点出现故障时。

how do I make sure this service has single instance regardless or number of Nodes/Partitions?

我们在答案的第一部分中涵盖了多个节点。关于分区:无状态服务只有 1 个分区,因此它对您的问题不起作用。

有关更多背景 Material ,请阅读 the docs about the service lifecycleabout replica lifecycles

关于azure - 限制所有服务结构节点中的一个服务实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55926525/

相关文章:

Azure Service Fabric 内部负载平衡

c# - Cosmos DB 响应 404

.net - 上次调试 session 的应用程序见解

C# 如何更新 Azure IoT 中心设备所需的孪生属性

c# - 多个 kestrel 无状态服务实例在服务结构中的不同端口上运行

azure - 错误 System.BadImageFormatException 服务结构

azure - 如何将 Azure Cosmos DB 与双 API(SQL 和 Mongo)连接

c# - 访问 Azure Service Fabric 有状态服务状态

azure-resource-manager - 部署中的 key 保管库值和链接的模板参数