enter image description here您好我正在尝试在 ubuntu 16.04 上配置 Elasticsearch ,并且能够与 Java 一起正确安装它。
当我在 ubuntu 终端 curl -X GET "localhost:9200"上运行命令时,它工作正常,我可以看到预期的结果。
但是,当我尝试在同一终端上运行命令时: curl -X GET "public_ipv4_of_ubuntu_server:9200",它抛出错误 "Connection denied"
我能够在 centos 服务器中执行此操作,但在 ubuntu 中我收到此错误。
网络主机:0.0.0.0
我尝试了许多可用的解决方案,但没有一个有效。你能帮我解决这个问题吗?
最佳答案
当您输入 0.0.0.0
作为主机,它只能通过 localhost
访问, 127.0.0.1
或环回地址。
如果您希望它可以被任何其他 IP 访问,您应该在 elasticsearch.yml
中配置http.publish_host
或 network.host
到服务器的公共(public) IP。不要忘记重启 Elasticsearch
更多信息 - https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html
关于ubuntu - Elasticsearch 问题-我使用命令 curl -X GET "localhost:9200",不工作 4 curl -X GET "public_ipv4_of_ubuntu_server:9200",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54268050/