“分区低于目标副本或实例计数”,在 Service Fabric 本地集群上使用有状态服务

“Partition is below target replica or instance count” with stateful services on Service Fabric Local Cluster

每当我在本地集群上部署任何项目时(即使遵循简单的在线 Service Fabric 教程)我都会收到以下消息:

System application is unhealthy.

Unhealthy services: 100% (1/1), ServiceType='EventStoreServiceType', MaxPercentUnhealthyServices=0%.

Unhealthy service: ServiceName='fabric:/System/EventStoreService', AggregatedHealthState='Error'.

Unhealthy partitions: 100% (1/1), MaxPercentUnhealthyPartitionsPerService=0%.

Unhealthy partition: PartitionId='00000000-0000-0000-0000-000000009000', AggregatedHealthState='Error'.

Error event: SourceId='System.FM', Property='State'. Partition is below target replica or instance count.

即使我有超过 120GB 的磁盘 space

部署等于或小于集群中节点数量的 amount of replicas。 因此,如果您是 运行 单个节点 dev cluster,请部署单个副本。如果要部署更多,则需要使用 5 节点开发集群。

显然这个问题与我的 C 盘有关,当我创建一个超过 10GB 的新驱动器 space 并将集群定位到该新驱动器时,问题就解决了。

我在尝试调试 Service Fabric 应用程序时遇到了这个问题。当我发布到本地节点时没有问题,但在调试模式下尝试 运行 时出现了完全相同的错误。

解法:

通过右键单击 Service Fabric 项目(带有 Service Fabric 图标的那个)转到 Service Fabric 项目属性 -> 属性 -> 应用程序调试模式 并将其设置为 删除应用程序。 默认情况下,它设置为 刷新应用程序 并且描述说它

'refreshes the application with new binaries without redeploying the application'

我的同事对该设置没有任何问题,但我们在几台机器上成功解决了该问题,因此值得一试。