ubuntu - Elasticsearch 问题-我使用命令 curl -X GET "localhost:9200",不工作 4 curl -X GET "public_ipv4_of_ubuntu_server:9200"

标签 ubuntu elasticsearch

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_hostnetwork.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/

相关文章:

ruby-on-rails - rails 服务器 bin/rails :6: warning: already initialized constant APP_PATH error

linux - bash 删除脚本不起作用

elasticsearch - 嵌套聚合elasticsearch,具有用于子聚合的访问父字段

elasticsearch - 过滤结果集上的elasticsearch聚合

elasticsearch - 如何从Java API删除所有X天的旧文档?

search - 为什么我的同义词什么都不返回?

python - Cmake:找不到 Python 2.7

apache - 使用 Laravel 5.1 安装 phpMyAdmin

ubuntu - 如何让 vim 在 Mac OS X 上像在 Ubuntu 上一样运行?

elasticsearch - elasticsearch减去两个数据集之间的数值字段