0
votes

I'm trying to setup 3 server nodes in my local machine. Each node starts but unable to join the cluster.

I can see the below message being logged in the log file for each server node.

Topology snapshot [ver=1, servers=1, clients=0, CPUs=4, heap=0.1GB]

Here is my code to start the server.

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);

Can anyone please suggest if I was missing something here!

2

2 Answers

0
votes

Try removing the address without the port and leave only the one that specifies the range:

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

Struggled with this for hours and could only solve it by doing the following.

  1. Ensure that you've set the local interface and port range on which your servers are 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. Configure your IP finder accordingly. Supposing that the node is to find peers on the same machine configured similarly (i.e., as per [1] above):

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

As instances start up in turn, they'll use ports within the configured range, and within that range, they'll discover one another using TCP discovery.

This is the only way I managed to connect 2+ server nodes on the same machine, without using multicast discovery.