2016-07-29 43 views
0

我试图在本地机器中设置3个服务器节点。每个节点启动但无法加入群集。服务器节点无法在Apache Ignite中发现彼此

我可以在每个服务器节点的日志文件中看到以下消息。

拓扑快照[版本= 1,服务器= 1,客户= 0,CPU的= 4,堆= 0.1GB]

这是我的代码,以启动服务器。

IgniteConfiguration config = new IgniteConfiguration(); 
TcpDiscoverySpi spi = new TcpDiscoverySpi(); 
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); 
ipFinder.setAddresses(Arrays.asList("192.168.0.3","192.168.0.3:47100..47120")); 
spi.setIpFinder(ipFinder); 
config.setDiscoverySpi(spi); 
// Start Ignite node. 
ignite = Ignition.start(config); 

任何人都可以请建议,如果我在这里失去了一些东西!

回答

0

尝试不端口取出地址,只留一个指定范围内的一个:这个挣扎了几个小时

ipFinder.setAddresses(Arrays.asList("192.168.0.3:47100..47120")); 
0

,只能通过执行以下操作解决它。

  1. 确保您设定的本地接口和端口范围上您的服务器LITENING:

    TcpDiscoverySpi spi = new TcpDiscoverySpi(); 
    
    //This address should be accessible to other nodes 
    spi.setLocalAddress("192.168.0.1"); 
    spi.setLocalPort(48500); 
    spi.setLocalPortRange(20); 
    
  2. 相应地配置IP取景器。假定节点是找到类似地配置(即,按照上述[1])在同一台机器上的对等:

    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(); 
    ipFinder.setAddresses("192.168.0.1:48500..48520"); 
    
    spi.setIpFinder(ipFinder); 
    

作为实例反过来启动时,他们将内配置使用的端口范围内,并且在此范围内,他们将使用TCP发现来发现彼此。

这是我设法在同一台机器上连接2+服务器节点而不使用多播发现的唯一方法。

相关问题