2016-10-29 34 views
0

我试图使用现有的Consul集群作为测试Orleans应用程序的成员资格提供程序。试图与Consul设置Orleans集群成员身份

我的客户端应用程序连接到筒仓

中找不到任何Orleans.Runtime.Host.ConsulBasedMembershipTable网关时,我得到这个错误。奥尔良客户端无法初始化。

挖掘到ConsulUtils类中,正在检索的条目没有定义ProxyPort - 并且被丢弃 - 因此是空的结果集。

我初始化这样的筒仓:

 var clusterConfiguration = new ClusterConfiguration(); 
     clusterConfiguration.Globals.DataConnectionString = "http://localhost:8500"; 
     clusterConfiguration.Globals.DeploymentId = "OrleansPlayground"; 
     clusterConfiguration.Globals.LivenessType = GlobalConfiguration.LivenessProviderType.Custom; 
     clusterConfiguration.Globals.MembershipTableAssembly = "OrleansConsulUtils"; 
     clusterConfiguration.Globals.ReminderServiceType = GlobalConfiguration.ReminderServiceProviderType.Disabled; 

     var silohost = new SiloHost("Fred", clusterConfiguration); 

     silohost.InitializeOrleansSilo(); 
     startup = Task.Factory.StartNew(() => 
     { 
      return silohost.StartOrleansSilo(); 
     }); 
     return true; 

我把我的客户端应用程序像这样:

 var config = new ClientConfiguration(); 

     config.CustomGatewayProviderAssemblyName = "OrleansConsulUtils"; 
     config.DataConnectionString = "http://localhost:8500"; 
     config.DeploymentId = "OrleansPlayground"; 
     config.GatewayProvider = ClientConfiguration.GatewayProviderType.Custom; 

     GrainClient.Initialize(config); 

综观ConsulUtils代码中,我可以看到ProxyPort不当条目被保存时设置(即为0)。所以我假设我在初始化筒仓时遇到了问题 - 但我无法弄清楚它是什么!

回答

0

没有深入挖掘,听起来像是一个错误。请转贴在GitHub上,我们会尽力帮助你。

+0

谢谢!我已经添加它作为一个问题 - https://github.com/dotnet/orleans/issues/2370 –