You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Lukas Lentner <ko...@lukaslentner.de> on 2017/01/10 21:24:14 UTC

Rediscovery after Startup

Hi,

can somebody please tell me how to force an ignite node programmatically to again try to discover other nodes it did not find at the startup process.

I use:

    final TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
    ipFinder.setShared(true);
    ipFinder.setAddresses(this.invocationSettings.getIgniteHosts());

    final TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();
    discoverySpi.setIpFinder(ipFinder);

There is only one address in getIgniteHosts() and it is not found at the startup. I would like to try it again after x seconds...
My Log shows me:

[main] INFO class org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi - Successfully bound to TCP port [port=47500, localHost=0.0.0.0/0.0.0.0]
[tcp-disco-msg-worker-#2%null%] DEBUG class org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi - Message worker started [locNodeId=1bfd35d5-b8e5-4ce9-9b0c-dc92ee067e39]
[main] DEBUG class org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi - Local node initialized: TcpDiscoveryNode [id=1bfd35d5-b8e5-4ce9-9b0c-dc92ee067e39, addrs=[0:0:0:0:0:0:0:1%lo, 127.0.0.1, 172.17.0.6], sockAddrs=[/0:0:0:0:0:0:0:1%lo:47500, /127.0.0.1:47500, a46e2d978c15/172.17.0.6:47500], discPort=47500, order=0, intOrder=0, lastExchangeTime=1484080062936, loc=true, ver=1.7.0#20160801-sha1:383273e3, isClient=false]
[main] DEBUG org.apache.ignite.internal.processors.continuous.GridContinuousProcessor - collectDiscoveryData [node=1bfd35d5-b8e5-4ce9-9b0c-dc92ee067e39, loc=1bfd35d5-b8e5-4ce9-9b0c-dc92ee067e39, locInfos={}, clientInfos={}]
[main] ERROR class org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi - Exception on direct send: Connection refused (Connection refused)
java.net.ConnectException: Connection refused (Connection refused)
                at java.net.PlainSocketImpl.socketConnect(Native Method)
                at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
                at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
                at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
                at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
                at java.net.Socket.connect(Socket.java:589)
                at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.openSocket(TcpDiscoverySpi.java:1269)
                at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.openSocket(TcpDiscoverySpi.java:1244)
                at org.apache.ignite.spi.discovery.tcp.ServerImpl.sendMessageDirectly(ServerImpl.java:1097)
                at org.apache.ignite.spi.discovery.tcp.ServerImpl.sendJoinRequestMessage(ServerImpl.java:950)
                at org.apache.ignite.spi.discovery.tcp.ServerImpl.joinTopology(ServerImpl.java:815)
                at org.apache.ignite.spi.discovery.tcp.ServerImpl.spiStart(ServerImpl.java:340)
                at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.spiStart(TcpDiscoverySpi.java:1837)
                at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:267)
                at org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:681)
                at org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1571)
                at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:901)
                at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1739)
                at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1589)
                at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1042)
                at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:569)
                at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:516)
                at org.apache.ignite.Ignition.start(Ignition.java:322)
                at XXX
[main] DEBUG class org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi - Failed to send join request message [addr=webApp/172.17.0.5:47500, msg=Connection refused (Connection refused)]
[main] DEBUG class org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi - Join request message has not been sent (local node is the first in the topology).
[main] DEBUG class org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi - Discovery notification [node=TcpDiscoveryNode [id=1bfd35d5-b8e5-4ce9-9b0c-dc92ee067e39, addrs=[0:0:0:0:0:0:0:1%lo, 127.0.0.1, 172.17.0.6], sockAddrs=[/0:0:0:0:0:0:0:1%lo:47500, /127.0.0.1:47500, a46e2d978c15/172.17.0.6:47500], discPort=47500, order=1, intOrder=1, lastExchangeTime=1484080062936, loc=true, ver=1.7.0#20160801-sha1:383273e3, isClient=false], spiState=CONNECTED, type=NODE_JOINED, topVer=1]
[main] DEBUG class org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi - Added topology snapshot to history, topVer=1, historySize=1

At the beginning I thought ignite might do this by itself, but it seems not to.

Thankx To you
Lukas

AW: AW: AW: AW: Rediscovery after Startup

Posted by Lukas Lentner <ko...@lukaslentner.de>.
Thankx. That did it!


----

Lukas Lentner, B. Sc.
 
St.-Cajetan-Straße 13
81669 München
Deutschland
 
Fon:     +49 / 89  / 71 67 44 96
Mobile:  +49 / 176 / 24 77 09 22
 
E-Mail:  Kontakt@LukasLentner.de
Website: www.LukasLentner.de

IBAN:    DE41 7019 0000 0002 1125 58
BIC:     GENODEF1M01 (Münchner Bank)

> -----Ursprüngliche Nachricht-----
> Von: vkulichenko [mailto:valentin.kulichenko@gmail.com]
> Gesendet: Mittwoch, 11. Januar 2017 23:50
> An: user@ignite.apache.org
> Betreff: Re: AW: AW: AW: Rediscovery after Startup
> 
> I just noticed that you set ipFinder.setShared(true); which actually causing
> this behavior. If you remove this line, B will wait for A in your case, as I
> described before.
> 
> -Val
> 
> 
> 
> --
> View this message in context: http://apache-ignite-
> users.70518.x6.nabble.com/Rediscovery-after-Startup-tp10007p10043.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: AW: AW: AW: Rediscovery after Startup

Posted by vkulichenko <va...@gmail.com>.
I just noticed that you set ipFinder.setShared(true); which actually causing
this behavior. If you remove this line, B will wait for A in your case, as I
described before.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Rediscovery-after-Startup-tp10007p10043.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

AW: AW: AW: Rediscovery after Startup

Posted by Lukas Lentner <ko...@lukaslentner.de>.
I have 2 server nodes A and B. Because of my setup only B knows the IP address of A not vice-versa. But B starts first. So while starting B tries to contact A (discovery) but does not reach it.

Then after a while A becomes available. A does not know anything about B.

I wish now that B by itself tries to discover A again (as while starting). My experience is that B just tries once at the beginning and not afterwards => How can I change this?

I wish that the discovery-process of node B goes on and on, but right now it stops after the first fail and feels happy being alone...


----

Lukas Lentner, B. Sc.
 
St.-Cajetan-Straße 13
81669 München
Deutschland
 
Fon:     +49 / 89  / 71 67 44 96
Mobile:  +49 / 176 / 24 77 09 22
 
E-Mail:  Kontakt@LukasLentner.de
Website: www.LukasLentner.de

IBAN:    DE41 7019 0000 0002 1125 58
BIC:     GENODEF1M01 (Münchner Bank)


> -----Ursprüngliche Nachricht-----
> Von: vkulichenko [mailto:valentin.kulichenko@gmail.com]
> Gesendet: Mittwoch, 11. Januar 2017 01:27
> An: user@ignite.apache.org
> Betreff: Re: AW: AW: Rediscovery after Startup
> 
> If node can't connect to any of the addresses, and can't bind to any of the
> addresses, it will actually wait and will join once someone is started. I
> probably do not understand the problem, please explain in more detail.
> 
> -Val
> 
> 
> 
> --
> View this message in context: http://apache-ignite-
> users.70518.x6.nabble.com/Rediscovery-after-Startup-tp10007p10014.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: AW: AW: Rediscovery after Startup

Posted by vkulichenko <va...@gmail.com>.
If node can't connect to any of the addresses, and can't bind to any of the
addresses, it will actually wait and will join once someone is started. I
probably do not understand the problem, please explain in more detail.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Rediscovery-after-Startup-tp10007p10014.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

AW: AW: Rediscovery after Startup

Posted by Lukas Lentner <ko...@lukaslentner.de>.
So it is not possible what I ask for? In my setup there is a reason why this node knows this IP and not the other way around ...

Re: AW: Rediscovery after Startup

Posted by vkulichenko <va...@gmail.com>.
Lukas,

New node connects to the one that is already running, not other way around.

Actually, for node to start it must be able to connect to one of the
addresses in the IP finder, OR be able to bind to one of these addresses. So
the fact that your node started means that its own address was provided in
the IP finder. If you use the same configuration of the IP finder on other
nodes (i.e. provide the address of already running node), they will
successfully join.

In other words, IP finder should provide one or more addresses and the first
node in topology must be started on one of these addresses.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Rediscovery-after-Startup-tp10007p10010.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

AW: Rediscovery after Startup

Posted by Lukas Lentner <ko...@lukaslentner.de>.
Hi,

yea the node is started and the only one in the topology. But It tries to discover 172.17.0.5 without luck. Now when 172.17.0.5 is available I would like to try to launch the discover-process again after the startup process. How can I achieve this?

I turned on DEBUG-logging on purpose!

Bye
Lukas

Re: Rediscovery after Startup

Posted by vkulichenko <va...@gmail.com>.
Lukas,

According to the log, this node is the first one in the topology and it is
successfully started, this is correct behavior. Can you clarify what is
wrong?

BTW, you see all these errors only because you have DEBUG logging enabled.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Rediscovery-after-Startup-tp10007p10008.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.