Cannot curl elasticsearch from outside network

Hi guys,

I am new to elasticsearch and my company currently have a project that needs to use elasticsearch, so this issue is quite ... urgent

I have installed elasticsearch 5 via this document

We are using centos 6.8, after installing elasticsearch, i have left configurations to the default, allow port 9200 and 9300 by command:

$ sudo iptables -A INPUT -p tcp -m tcp --dport 9200 -j ACCEPT
$ sudo iptables -A INPUT -p tcp -m tcp --dport 9300 -j ACCEPT
$ sudo /etc/init.d/iptables save

then try to connect by curl -XGET 'server_ip:9200/?pretty', it returns connection refused.

I have try to install elasticsearch on centos 7 and it works perfectly, but my company requires install on centos6.8

Any solutions or advises?

Very appreciate !

A few things you can try/check

  • Use netstat to see which IP Elasticsearch binds to ( or the server IP)
  • Can you do curl on the server itself?
  • Disable iptables completely and try again
  • Does telnet to server_ip 9200 work?

Apart from the suggested debugging above: Making ES publicly accessible generally is a very bad idea. For some background on the reasoning read here (though a bit older, most of the information is still valid and relevant):

Would you mind sharing your use case of why you need public access?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.