ElasticSearch installation error - curl: (7) Faile

2019-05-03 18:55发布

问题:

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.

回答1:

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


回答2:

run this command.

curl -X GET http://localhost:9200