You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by abhishek dutta gupta <ab...@gmail.com> on 2017/07/06 13:55:32 UTC

Connecting to remote host from client gives error

[01:34:23] REST protocols do not start on client node. To start the protocols
on client node set '-DIGNITE_REST_START_ON_CLIENT=true' system property.
[01:34:23] Failed to connect to any address from IP finder (will retry to
join topology every 2 secs): [/10.133.71.210:47500]
[01:39:24] Failed to connect to any address from IP finder (will retry to
join topology every 2 secs): [/10.133.71.210:47500]
[01:44:24] Failed to connect to any address from IP finder (will retry to
join topology every 2 secs): [/10.133.71.210:47500]
[01:49:24] Failed to connect to any address from IP finder (will retry to
join topology every 2 secs): [/10.133.71.210:47500]

My code:
-----------

TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
		TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
		List<String> addressList = new ArrayList<>();
		addressList.add("10.133.71.210:47500");
		//addressList.add("127.0.0.1:47501");
		/*
		 * addressList.add("127.0.0.1:47502");
		 * addressList.add("127.0.0.1:47503");
		 * addressList.add("127.0.0.1:47504"); addressList.add("localhost");
		 */

		ipFinder.setAddresses(addressList);
		tcpDiscoverySpi.setIpFinder(ipFinder);
		tcpDiscoverySpi.setLocalAddress("10.133.71.210");
		/*
		 * OptimizedMarshaller optimize = new OptimizedMarshaller();
		 * optimize.setRequireSerializable(false);
		 */
		IgniteConfiguration cfg = new IgniteConfiguration();
		//cfg.setLocalHost("10.133.71.210");
		cfg.setClientMode(true);
		//cfg.setre
		//cfg.setPeerClassLoadingEnabled(false);
		/*
		 * cfg.setMarshaller(optimize); cfg.setMarshaller(optimize);
		 */
		cfg.setDiscoverySpi(tcpDiscoverySpi);
		Ignite ignite = Ignition.start(cfg);
		//Ignite ignite =
Ignition.start("C:/Doc/apache-ignite-fabric-2.0.0-bin/examples/config/example-ignite.xml");
		IgniteCache<Integer, String> cache = ignite.cache(CACHE_NAME);
		
		IgniteCompute asyncCompute = ignite.compute().withAsync();

		List<IgniteFuture&lt;?>> futs = new ArrayList<>();
		
		for (int i = 0; i < KEY_CNT; i++) {
		    final int key = i;
		 
		    // This closure will execute on the remote node where
		    // data with the 'key' is located.
		    asyncCompute.affinityRun(CACHE_NAME, key, new IgniteRunnable() {
		        @Override public void run() {
		            // Peek is a local memory lookup.
		            System.out.println("Co-located [key= " + key + ", value= " +
cache.get(key) +']');
		        }
		    });
		}
		

		




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Connecting-to-remote-host-from-client-gives-error-tp14395.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Connecting to remote host from client gives error

Posted by abhishek dutta gupta <ab...@gmail.com>.
Failed to initialize connection (this can happen due to short time network
problems and can be ignored if does not 
affect node discovery)
[sock=Socket[addr=/10.133.71.210,port=32934,localport=47500]]
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:171)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
        at
org.apache.ignite.spi.discovery.tcp.ServerImpl$SocketReader.body(ServerImpl.java:5587)
        at
org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)


While I am trying to do telnet host port it gives the above error? I am also
unable to connect to this through client:

System.out.println("Test Ignite!!");
        String cacheId = "partitioned";
        TcpDiscoverySpi spi = new TcpDiscoverySpi();
        TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
        TcpDiscoveryMulticastIpFinder tcMp = new
TcpDiscoveryMulticastIpFinder();
        tcMp.setAddresses(Arrays.asList("10.133.71.210",
"10.133.71.210:47500..47501"));
        spi.setIpFinder(tcMp);

       // final String
PATH="/Users/shamim/Development/java/datafabrics/apache-ignite-fabric-1.5.0.final-bin/examples/config/example-cache.xml";
        IgniteConfiguration cfg = new IgniteConfiguration();
        cfg.setClientMode(true);
        cfg.setDiscoverySpi(spi);
        // Start ignite
        Ignite ignite = Ignition.start(cfg);

        // get or create cache
        IgniteCache<Integer, String> cache =
ignite.getOrCreateCache("myCacheName");
        for(int i = 1; i < 100; i++){
            cache.put(i, Integer.toString(i));
        }
        for(int i =1; i<100;i++){
            System.out.println("Cache get:"+ cache.get(i));
        }
        // statistics
        System.out.println("Cache Size:"+
cache.metrics(ignite.cluster()).getSize());
        ignite.close();



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Connecting-to-remote-host-from-client-gives-error-tp14395p14474.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Connecting to remote host from client gives error

Posted by vkulichenko <va...@gmail.com>.
It's something in your network. If you can't telnet to this address, Ignite
will obviously not able to connect either.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Connecting-to-remote-host-from-client-gives-error-tp14395p14498.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Connecting to remote host from client gives error

Posted by abhishek dutta gupta <ab...@gmail.com>.
Failed to initialize connection (this can happen due to short time network
problems and can be ignored if does not
affect node discovery)
[sock=Socket[addr=/10.133.71.210,port=32934,localport=47500]]
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:171)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
        at
org.apache.ignite.spi.discovery.tcp.ServerImpl$SocketReader.body(ServerImpl.java:5587)
        at
org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)


While I am trying to do telnet host port it gives the above error? I am also
unable to connect to this through client:

System.out.println("Test Ignite!!");
        String cacheId = "partitioned";
        TcpDiscoverySpi spi = new TcpDiscoverySpi();
        TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
        TcpDiscoveryMulticastIpFinder tcMp = new
TcpDiscoveryMulticastIpFinder();
        tcMp.setAddresses(Arrays.asList("10.133.71.210",
"10.133.71.210:47500..47501"));
        spi.setIpFinder(tcMp);

       // final String
PATH="/Users/shamim/Development/java/datafabrics/apache-ignite-fabric-1.5.0.final-bin/examples/config/example-cache.xml";
        IgniteConfiguration cfg = new IgniteConfiguration();
        cfg.setClientMode(true);
        cfg.setDiscoverySpi(spi);
        // Start ignite
        Ignite ignite = Ignition.start(cfg);

        // get or create cache
        IgniteCache<Integer, String> cache =
ignite.getOrCreateCache("myCacheName");
        for(int i = 1; i < 100; i++){
            cache.put(i, Integer.toString(i));
        }
        for(int i =1; i<100;i++){
            System.out.println("Cache get:"+ cache.get(i));
        }
        // statistics
        System.out.println("Cache Size:"+
cache.metrics(ignite.cluster()).getSize());
        ignite.close(); 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Connecting-to-remote-host-from-client-gives-error-tp14395p14475.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Connecting to remote host from client gives error

Posted by vkulichenko <va...@gmail.com>.
Then it might be blocked by firewall. These messages simply mean that client
can't establish connection with this socket address.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Connecting-to-remote-host-from-client-gives-error-tp14395p14444.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Connecting to remote host from client gives error

Posted by Abhishek Gupta <ab...@gmail.com>.
Yes I do have a server nodes which is hosted on this ip address port
10.133.71.210:47500", I have run it by running ignite.sh.

It does not seem to be working. Any idea?

-Abhishek

On Fri, Jul 7, 2017 at 4:24 AM, vkulichenko <va...@gmail.com>
wrote:

> You're starting a client node and it connect to server cluster. Do you have
> any server nodes?
>
> -Val
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Connecting-to-remote-host-from-client-gives-error-
> tp14395p14434.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: Connecting to remote host from client gives error

Posted by vkulichenko <va...@gmail.com>.
You're starting a client node and it connect to server cluster. Do you have
any server nodes?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Connecting-to-remote-host-from-client-gives-error-tp14395p14434.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.