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

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-common-netty-channel-connecttimeoutexception-connection-timed-out/36251>\
**Category:** Elasticsearch\
**Created:** [December 3, 2015, 7:39am UTC](https://discuss.elastic.co/t/org-elasticsearch-common-netty-channel-connecttimeoutexception-connection-timed-out/36251 "2015-12-03T07:39:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shivang\_Sarawagi](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@Shivang\_Sarawagi](https://discuss.elastic.co/u/Shivang_Sarawagi)\
**Post date:** [December 3, 2015, 7:39am UTC](https://discuss.elastic.co/t/org-elasticsearch-common-netty-channel-connecttimeoutexception-connection-timed-out/36251/1 "2015-12-03T07:39:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 3, 2015, 8:03am UTC](https://discuss.elastic.co/t/org-elasticsearch-common-netty-channel-connecttimeoutexception-connection-timed-out/36251/2 "2015-12-03T08:03:54Z")

</div>

Firewall? Is the port 9300 accessible from outside?

---

<div class="post-metadata">

**Author:** ![Shivang\_Sarawagi](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@Shivang\_Sarawagi](https://discuss.elastic.co/u/Shivang_Sarawagi)\
**Post date:** [December 3, 2015, 8:04am UTC](https://discuss.elastic.co/t/org-elasticsearch-common-netty-channel-connecttimeoutexception-connection-timed-out/36251/3 "2015-12-03T08:04:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 3, 2015, 8:54am UTC](https://discuss.elastic.co/t/org-elasticsearch-common-netty-channel-connecttimeoutexception-connection-timed-out/36251/4 "2015-12-03T08:54:15Z")

</div>

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...

---

<div class="post-metadata">

**Author:** ![Shivang\_Sarawagi](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@Shivang\_Sarawagi](https://discuss.elastic.co/u/Shivang_Sarawagi)\
**Post date:** [December 3, 2015, 9:15am UTC](https://discuss.elastic.co/t/org-elasticsearch-common-netty-channel-connecttimeoutexception-connection-timed-out/36251/5 "2015-12-03T09:15:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:33pm UTC](https://discuss.elastic.co/t/org-elasticsearch-common-netty-channel-connecttimeoutexception-connection-timed-out/36251/6 "2017-07-05T23:33:57Z")

</div>


