Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 400
Mojtaba Avatar asked Nov 27 '22 04:11

Mojtaba


1 Answers

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
like image 76
Manish Singh Avatar answered Dec 05 '22 22:12

Manish Singh