azure-service-fabric - 分区的主实例或无状态实例的地址无效

标签 azure-service-fabric

我使用开箱即用的分区创建了一个有状态服务:

<StatefulService ServiceTypeName="ExamplesServiceType" TargetReplicaSetSize="[ExamplesService_TargetReplicaSetSize]" MinReplicaSetSize="[ExamplesService_MinReplicaSetSize]">
            <UniformInt64Partition PartitionCount="[ExamplesService_PartitionCount]" LowKey="-9223372036854775808" HighKey="9223372036854775807" />
         </StatefulService>

服务 list 将参数设置为(开箱即用):
 <Parameter Name="ExampleService_PartitionCount" Value="1" />
 <Parameter Name="ExampleService_MinReplicaSetSize" Value="2" />
 <Parameter Name="ExampleService_TargetReplicaSetSize" Value="3" />
 <Parameter Name="WebService_InstanceCount" Value="1" />

现在我想从同一个集群中的无状态服务调用我的有状态服务:
 ServiceUriBuilder builder = new ServiceUriBuilder(ExampleServiceName);
 var service = ServiceProxy.Create<IExampleService>(builder.ToUri(),new ServicePartitionKey(1));

 return service.MyCallAsync(id);

我收到以下错误:

The primary or stateless instance for the partition 'a67f7afa-3370-4e6f-ae7c-15188004bfa1' has invalid address, this means that right address from the replica/instance is not registered in the system



我试图将日志访问到事件日志并且日志带有“partitionId”的有状态服务:“a67f7afa-3370-4e6f-ae7c-15188004bfa1”。

我错过了什么?

最佳答案

对于那些使用 Microsoft.ServiceFabric.Services.Remoting 的人版本 3.3.638,
我发现没有名为 CreateServiceInstanceListeners() 的扩展方法.我只找到了CreateServiceRemotingInstanceListeners()CreateServiceRemotingReplicaListeners()Microsoft.ServiceFabric.Services.Remoting.Runtime.ServiceRemotingExtensions .

这段代码为我编译:

    protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
    {
        return this.CreateServiceRemotingInstanceListeners();
    }

关于azure-service-fabric - 分区的主实例或无状态实例的地址无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36590933/

相关文章:

ssl - 几分钟后 HTTPS 连接停止工作

c# - 从 Service Fabric 内部关闭 StatelessService 实例的最佳实践

c# - Service Fabric 如何选择用于托管服务的端口?

c# - 将 SignalR 与 Azure Service Fabric 结合使用

c# - Microsoft.Net.Http.Server.WebListenerException(0x80004005): The prefix 'https://+:44384/' is already registered

azure - 是否可以将基于 IIS 的应用程序部署到 Service Fabric 中?

.net - 使用Azure Service Fabric的默认客户端时如何向请求添加消息头?

c# - 创建新的 Azure Service Fabric 有状态服务时出现异常

asp.net-core - 具有 Asp.net Core 依赖注入(inject)的 Service Fabric 有状态服务

c# - 如何使用 PowerShell 安装此 Service Fabric 项目?