Org.elasticsearch.common.netty.channel.ConnectTimeoutException: connection timed out:


(Shivang Sarawagi) #1

I have an elastic server deployed on a remote machine & using the Java API to connect to it.
The connection works fine when hit from my local sandbox machine. But when I deploy my code to the dev environment.

The connection exception occurs when the code tries to connect to the remote elastic server

2015-12-02 23:49:15.621 [main] DEBUG o.e.c.transport - [Shockwave] adding address [[#transport#-1][sb2-007][inet[xxxxxx.com/xxxx:9300]]]
2015-12-02 23:49:45.729 [elasticsearch[Shockwave][management][T#1]] DEBUG o.e.c.transport - [Shockwave] failed to connect to node [[#transport#-1][sb2-007][inet[xxxxxxx.com/xxxxxxxxx:9300]]], ignoring...
org.elasticsearch.transport.ConnectTransportException: [][inet[xxxxxx.com/xxxxxx:9300]] connect_timeout[30s]
	at org.elasticsearch.transport.netty.NettyTransport.connectToChannelsLight(NettyTransport.java:790) ~[elasticsearch-1.6.0.jar!/:na]
	at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:754) ~[elasticsearch-1.6.0.jar!/:na]
	at org.elasticsearch.transport.netty.NettyTransport.connectToNodeLight(NettyTransport.java:726) ~[elasticsearch-1.6.0.jar!/:na]
	at org.elasticsearch.transport.TransportService.connectToNodeLight(TransportService.java:220) ~[elasticsearch-1.6.0.jar!/:na]
	at org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1.run(TransportClientNodesService.java:439) ~[elasticsearch-1.6.0.jar!/:na]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_55]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_55]
	at java.lang.Thread.run(Thread.java:744) [na:1.7.0_55]

Can anyone tell me the reason why this is happening?


(David Pilato) #2

Firewall? Is the port 9300 accessible from outside?


(Shivang Sarawagi) #3

well the port is accessible when running from the local machine, port 9300 doesn't support HTTP how do I access it from the outside?


(David Pilato) #4

If the port 9300 is opened (check your firewall settings if any), then it should be accessible from outside unless you are using elasticsearch 2.0 and default configuration or an older version with modified settings.

You can try to telnet your machine on this port and check if it's connecting...


(Shivang Sarawagi) #5

thanks for the reply, probably some issue with the environment I am unable to connect to the port even after disabling the firewall.


(system) #6