我有一个无状态服务结构服务,它基本上以指定的时间间隔进行批处理。因此,拥有多个实例会使事情变得复杂,因为每个实例都会尝试执行相同的批处理作业。
我严格要求运行单个批处理过程。目前我已在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 lifecycle和 about replica lifecycles
关于azure - 限制所有服务结构节点中的一个服务实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55926525/