Hi,

Still getting this error.
2017-11-23 08:59:27  [tcp-disco-msg-worker-#3%nvIDNGB1%] ERROR 
TcpDiscoverySpi:495 - Failed to connect to next node 
[msg=TcpDiscoveryNodeAddedMessage [node=TcpDiscoveryNode 
[id=a11e7f8b-6d64-4620-a296-1a52fb253a48, addrs=[10.131.12.16], 
sockAddrs=[/10.131.12.16:1510], discPort=1510, order=0, intOrder=3, 
lastExchangeTime=1511427557675, loc=false, ver=2.1.0#20170720-sha1:a6ca5c8a, 
isClient=false], 
dataPacket=o.a.i.spi.discovery.tcp.internal.DiscoveryDataPacket@516aef1f, 
discardMsgId=null, discardCustomMsgId=null, top=null, clientTop=null, 
gridStartTime=1511427411342, super=TcpDiscoveryAbstractMessage [sndNodeId=null, 
id=5470818ef51-36f0e1f5-fe2e-4b2c-9f9d-bdd4f95f6cb0, 
verifierNodeId=36f0e1f5-fe2e-4b2c-9f9d-bdd4f95f6cb0, topVer=0, pendingIdx=0, 
failedNodes=null, isClient=false]], err=connect timed out]
java.net.SocketTimeoutException: connect timed out

it looks like the node1  is trying to connect on private Iof node2P. If I give 
Public IP as discovery Local Address nodes won’t start. Could someone help me 
understand what should be the configuration when public and private IPs are 
involved? I have created the below address resolver configuration

package com.hm.ignite.repositories;

import java.net.InetSocketAddress;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.configuration.AddressResolver;
import org.apache.ignite.internal.util.typedef.F;

public class AddressResolverImpl implements AddressResolver {
    /** Internal address on external address. */
    private static Map<InetSocketAddress, List<InetSocketAddress>> maps = new 
HashMap<>();

    static {
        maps.put(new InetSocketAddress("206.142.241.45", 47500), F.asList(new 
InetSocketAddress("10.105.244.17", 31183)));
        maps.put(new InetSocketAddress("205.139.17.146", 47500), F.asList(new 
InetSocketAddress("10.131.12.16", 30112)));
        maps.put(new InetSocketAddress("10.105.244.17", 47500), F.asList(new 
InetSocketAddress("206.142.241.45", 31183)));
        maps.put(new InetSocketAddress("10.131.12.16", 47500), F.asList(new 
InetSocketAddress("205.139.17.146", 30112)));
    }

    /** {@inheritDoc} */
    @Override public Collection<InetSocketAddress> 
getExternalAddresses(InetSocketAddress addr)
        throws IgniteCheckedException {
        return maps.get(addr);
    }
}


From: Josephine Barboza
Sent: Wednesday, November 22, 2017 5:13 PM
To: [email protected]
Subject: RE: Node unable to join cluster

Hi Denis,

After adding the localAddress in TcpDiscoverySpi, the node is still not 
starting. It fails with the below log messages

2017-11-22 11:25:36  [localhost-startStop-1] DEBUG TcpDiscoverySpi:452 - 
Handshake response from local node: TcpDiscoveryHandshakeResponse [order=0, 
super=TcpDiscoveryAbstractMessage [sndNodeId=null, 
id=089b073ef51-41a2ab42-639c-48f0-ad36-b75cd625939a, verifierNodeId=null, 
topVer=0, pendingIdx=0, failedNodes=null, isClient=false]]
2017-11-22 11:25:36  [localhost-startStop-1] DEBUG TcpDiscoverySpi:452 - Failed 
to send join request message [addr=/206.142.241.45:1510, msg=Failed to send 
message to address [addr=/206.142.241.45:1510, 
msg=TcpDiscoveryJoinRequestMessage [node=TcpDiscoveryNode 
[id=41a2ab42-639c-48f0-ad36-b75cd625939a, addrs=[0:0:0:0:0:0:0:1%lo, 
10.105.244.16, 10.105.244.17, 127.0.0.1], sockAddrs=[/10.105.244.17:1510, 
/0:0:0:0:0:0:0:1%lo:1510, /10.105.244.16:1510, /127.0.0.1:1510], discPort=1510, 
order=0, intOrder=0, lastExchangeTime=1511349337034, loc=true, 
ver=2.1.0#20170720-sha1:a6ca5c8a, isClient=false], 
dataPacket=org.apache.ignite.spi.discovery.tcp.internal.DiscoveryDataPacket@432a7606<mailto:dataPacket=org.apache.ignite.spi.discovery.tcp.internal.DiscoveryDataPacket@432a7606>,
 super=TcpDiscoveryAbstractMessage [sndNodeId=null, 
id=343b073ef51-41a2ab42-639c-48f0-ad36-b75cd625939a, verifierNodeId=null, 
topVer=0, pendingIdx=0, failedNodes=null, isClient=false]]]]


Below is my configuration


          // Comm spi
          TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
          commSpi.setLocalPort(1511);
          commSpi.setLocalPortRange(1);
          commSpi.setName(“commSpi”);
          igniteCfg.setCommunicationSpi(commSpi);
          igniteCfg.setNetworkTimeout(20000);

    // IP Finder
          TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
          String[] addresses = {“ 206.142.241.45”}; // This is the public IP of 
my VM which has two ports open 1510 and 1511
          ipFinder.setAddresses(addresses);


          // Discovery SPI
    TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();
          discoverySpi.setLocalPort(1510);
          discoverySpi.setLocalPortRange(1);
          discoverySpi.setIpFinder(ipFinder);
          discoverySpi.setNetworkTimeout(20000);
          discoverySpi.setName(“discoSpi”);
          discoverySpi.setLocalAddress(“206.142.241.45”);


          // Address Resolver
          Map<String, String> addrMap = new Hashmap<>();
          addrMap.put(“10.105.244.17”, “206.142.241.45”);

    AddressResolver addrResolvr = new BasicAddressResolver(addrMap);
          discoverySpi.setAddressResolver(addrResolvr);

          igniteCfg.setDiscoverySpi(discoverySpi);


I am still unable to start a local node if I use the public IP in IPFinder.
What could be the issue here?


From: Denis Mekhanikov [mailto:[email protected]]
Sent: Tuesday, November 21, 2017 6:15 PM
To: [email protected]<mailto:[email protected]>
Subject: Re: Node unable to join cluster

Hi Josephine!

Make sure, that TcpDiscoveryVmIpFinder has address of the local node on the 
list.
Otherwise the first node won't be able to start, because discovery SPI won't 
find any nodes.

Also note, that TcpDiscoverySpi has localAddress and localPort properties. Try 
setting them according to your public IP and port.

Refer to this page for more information: 
https://apacheignite.readme.io/docs/cluster-config

Denis

вт, 21 нояб. 2017 г. в 15:11, Josephine Barboza 
<[email protected]<mailto:[email protected]>>:
Hi,

I have setup ignite instances on two different VMs and I’m trying to create a 
cluster using Static IP discovery using TcpDiscoveryVmIpFinder.
I have a couple of questions:

  1.  Do I need to give loopback address or public IP for the node to start 
before trying to connect to the other node in the cluster? What is the 
recommended configuration for production?
  2.  When I give loopback address/private IP it works(node starts before 
trying the connect to other node) but when I give the public IP it does not. 
Both the ports for discoverySpi and commSpi are open on the public IP and I 
have used address resolver as well to map the private IP to the public IP. Is 
there any other configuration required?
  3.  Facing the same issue as mentioned in point 2 while connecting to the 
node on the second VM where in spite of using address resolver the node is 
unable to join the topology.

Thanks.

IMPORTANT NOTICE: This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this email in error, please notify the system 
manager and/or the sender immediately.

Reply via email to