所以我在虚拟机中安装了 CentOs,然后 Elasticsearch ,我将它的网络设置为网桥。
Elasticsearch 1.7.3 当然正在运行。
我可以毫无问题地通过 SSH 连接它,但是 curl 无法正常工作
curl '163.113.183.229:9200/_cat/indices?v'
curl: (7) couldn't connect to host
我可以看什么来确定问题?谢谢
编辑
CentOs 7 阻塞了我打开的 80 端口,但没有改变:
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
最佳答案
Elasticsearch 2.0 及更高版本默认只回答来自 localhost 的请求。
要从其他机器连接,请编辑 elasticsearch.yml
并添加:
network.host: ["_local_", "_non_loopback_"]
关于从主机 curl VM 中的 Elasticsearch 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35871602/