我的ES 2.2安装在我的数字海洋水滴上。我的ES配置文件如下所示
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: "My Droplet Ip address"
network.bind_host: 127.0.0.1
http.publish_port: 9200
http.port: 9200
#
# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# http.cors.enabled: true
#http.cors.allow-origin: "*"
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
# discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
# discovery.zen.minimum_master_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
现在,当我尝试卷曲-XGET localhost:9200时它工作正常,但是当我尝试从远程访问我的ES&#34; http://IpAddress:9200时给了我CONNECTION REFUSED也卷曲-XGET IPAddress:9200给了我连接被拒绝
这适用于ES 1.4,但是2.X已经开始给我连接问题了
答案 0 :(得分:1)
您有两种解决方案:
一个。您可以将network.bind_host
更改为您的公共IP地址
B中。您删除network.bind_host
并仅保留network.host
您的公共IP地址。后者会将network.bind_host
和network.publish_host
都设置为您的公共IP地址。
还要确保删除行首的所有空格。