azure-service-fabric - 每个节点有一个以上的无状态服务实例

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

我的无状态服务从服务总线队列接收任务并处理它。我现在正在尝试寻找一种尽可能多地使用 Service Fabric 节点资源的最佳方式。所以我看到 2 种方法:1)在服务内部创建多个线程 2)为每个节点创建多个服务实例。我认为第二种方式更安全和正确,但是当我为 1 节点集群指定 InstanceCount = 5 时,我收到了警告。

配置文件

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="fabric:/EmailSenderApp" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters>
    <Parameter Name="MainService_InstanceCount" Value="1" />
    ...
  </Parameters>
</Application>

错误:
Unhealthy event: SourceId='System.FM', Property='State', HealthState='Warning', ConsiderWarningAsError=false.
Partition is below target replica or instance count.
fabric:/EmailSenderApp/EmailSenderMainService 5 1 09916a6b-1701-46ce-a281-0e223a68f980
Ready _Node_0 131708550454646056
(Showing 1 out of 1 instances. Total available instances: 1)

最佳答案

目前不可能在同一节点上有多个主分区。

SF 有放置限制来阻止这个,我认为这是一个错误,b 因为没有担心在无状态服务上丢失状态,因此我打开了一个 GitHub 问题到 Allow singleton stateless services to have multiple instances per node bypassing placement constraint

为了对这个问题进行排序,我将引导您使用解决类似问题的选项来回答这个问题:

Simulate 10,000 Azure IoT Hub Device connections from Azure Service Fabric cluster

关于azure-service-fabric - 每个节点有一个以上的无状态服务实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50349125/

相关文章:

azure - 在服务结构上托管多个公共(public)站点

azure - 在应用程序网关后面配置 Service Fabric

azure - 升级 Service Fabric Azure 上的服务无法访问状态

azure - 在 Service Fabric 应用程序中动态创建服务

azure - Service Fabric : System. ArgumentException:找不到具有此 ID 的接口(interface) -488762776

azure-service-fabric - 使用 Azure Service Fabric 编排本地开发或测试环境

azure-service-fabric - 服务结构和 IPv4

azure-service-fabric - 服务结构损坏 : SfDevCluster not created

c# - 如何从 Winform 应用程序调用 Service Fabric 服务?

c# - Azure Service Fabric 完成后如何重新运行 RunAsync 方法?