ElasticSearch安装错误-curl:(7)无法连接到localhost:9200;拒绝连接
问题描述:
我正在尝试使用此教程
我完成了除教程第4步之外的所有操作。
I did everything except step 4 of the tutorial.
在步骤5中,当我运行此命令时:
In step 5, when I run this command:
curl -X GET 'http://localhost:9200'
我收到此错误:
curl: (7) Failed connect to localhost:9200; Connection refused
我尝试了两种方法来修复错误:
I have tried two different things to fix the error:
-
network.bind_host:0.0.0.0
network.bind_host: 0.0.0.0
网络:
主机:192.168.2.229
network : host : 192.168.2.229
但都没有解决问题。
我应该怎么做才能测试Elasticsearch并解决此错误?
What should I do to test Elasticsearch and solve this error?
谢谢。
答
您只需在弹性搜索配置文件中取消注释以下行:
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