connection timed out:

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[]]]
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[]]], ignoring...
org.elasticsearch.transport.ConnectTransportException: [][inet[]] connect_timeout[30s]
	at org.elasticsearch.transport.netty.NettyTransport.connectToChannelsLight( ~[elasticsearch-1.6.0.jar!/:na]
	at org.elasticsearch.transport.netty.NettyTransport.connectToNode( ~[elasticsearch-1.6.0.jar!/:na]
	at org.elasticsearch.transport.netty.NettyTransport.connectToNodeLight( ~[elasticsearch-1.6.0.jar!/:na]
	at org.elasticsearch.transport.TransportService.connectToNodeLight( ~[elasticsearch-1.6.0.jar!/:na]
	at org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$ ~[elasticsearch-1.6.0.jar!/:na]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [na:1.7.0_55]
	at java.util.concurrent.ThreadPoolExecutor$ [na:1.7.0_55]
	at [na:1.7.0_55]

Can anyone tell me the reason why this is happening?

Firewall? Is the port 9300 accessible from outside?

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?

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

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