ElasticSearch installation error - curl: (7) Failed connect to localhost:9200; Connection refused

Mojtaba picture Mojtaba · Apr 14, 2016 · Viewed 15.9k times · Source

I'm trying to configure ElasticSearch with this tutorial

I did everything except step 4 of the tutorial.


In step 5, when I run this command:

curl -X GET 'http://localhost:9200'

I get this error:

curl: (7) Failed connect to localhost:9200; Connection refused

I have tried two different things to fix the error:

  1. network.bind_host: 0.0.0.0

  2. network : host : 192.168.2.229

But neither solved the problem.

What should I do to test Elasticsearch and solve this error?

Thanks.

Answer

Manish Singh picture Manish Singh · Jan 18, 2017

You just have to uncomment these lines in your elastic-search configuration file:

cluster.name: your_cluster_name 
node.name: "Your Node Name"
network.bind_host: localhost
network.publish_host: 0.0.0.0
network.host: 0.0.0.0