c# - Orleans 为Liveness指定SqlServer

标签 c# sql-server orleans

我正在尝试为使用 SQL Server 的 Orleans 设置一个测试环境。这是我的服务器配置文件:

<?xml version="1.0" encoding="utf-8" ?>
<OrleansConfiguration xmlns="urn:orleans">
  <Globals>
    <Liveness LivenessType="SqlServer" DeploymentId="42783519-d64e-44c9-9c29-111111111133" DataConnectionString="Data Source=.\\SQLEXPRESS;Initial Catalog=Orleans;Integrated Security=True;" />
    <!--<SeedNode Address="localhost" Port="11111" />-->
  </Globals>
  <Defaults>
    <Networking Address="localhost" Port="11111" />
    <ProxyingGateway Address="localhost" Port="30000" />
    <Tracing DefaultTraceLevel="Info" TraceToConsole="true" TraceToFile="{0}-{1}.log">
      <TraceLevelOverride LogPrefix="Application" TraceLevel="Info" />
    </Tracing>
    <Statistics MetricsTableWriteInterval="30s" PerfCounterWriteInterval="30s" LogWriteInterval="300s" WriteLogStatisticsToTable="true" />
  </Defaults>
  <Override Node="Primary">
    <Networking Address="localhost" Port="11111" />
    <ProxyingGateway Address="localhost" Port="30000" />
  </Override>
</OrleansConfiguration>

当我使用这个配置时,我在运行时遇到了这个错误:

MembershipTableGrain cannot run without Seed node - please check your silo configuration file and make sure it specifies a SeedNode element. Alternatively, you may want to use AzureTable for LivenessType. Parameter name: grain = MembershipTableGrain Exception = System.ArgumentException: MembershipTableGrain cannot run without Seed node - please check your silo configuration file and make sure it specifies a SeedNode element. Alternatively, you may want to use AzureTable for LivenessType.

更进一步,日志显示 Liveness 是 MembershipTableGrain(这是默认值并且需要 SeeNode)。我在这里缺少什么?

最佳答案

我的 SQLServer 成员资格的筒仓配置如下所示

<?xml version="1.0" encoding="utf-8"?>
<OrleansConfiguration xmlns="urn:orleans">
    <Globals>
        <SystemStore SystemStoreType="SqlServer" DeploymentId="YYYYY" DataConnectionString="Server=THESERVER;Database=Orleans;User ID=USER;password=PASSWORD;"/>
    </Globals>
    <Defaults>
        <Networking Address="" Port="11111"/>
        <ProxyingGateway Address="" Port="30000"/>
    </Defaults>
</OrleansConfiguration>

无需指定活体类型。它通过查看 SystemStoreType 来计算。

客户端配置确实需要指定网关

<ClientConfiguration xmlns="urn:orleans">

  <SystemStore SystemStoreType ="SqlServer" 
                 DeploymentId="YYY" 
                 DataConnectionString="Server=THESERVER;Database=Orleans;User ID=USER;password=PASSWORD;" />

  <GatewayProvider ProviderType="SqlServer"/>
</ClientConfiguration>

关于c# - Orleans 为Liveness指定SqlServer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34620854/

相关文章:

SQL - 选择等于日期的记录,或者如果日期为空则显示所有记录

sql-server - 关闭探查器而不先停止它

ASP.NET Core 项目中的 Orleans 直接客户端

c# - Orleans 7.0 序列化程序无法与源自 Nuget 包的 POCO 一起使用

c# - 无法从 docker 网络外部连接到容器中的筒仓

c# - 为什么在调用 IHost.StopAsync 时会调用两次 IHostedService.StopAsync?

c# - C# 上的注册表和 Wow6432Node

c# text/winForm 覆盖 xfire、PIX、steam、fraps 等视频游戏

c# - 代码如何通过引用传递?

sql-server - 连接 nvarchar(max) 值似乎不起作用(+= 用作 =)