0

我的数字海洋水滴上安装了我的 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>

现在,当我尝试 curl -XGET localhost:9200 它可以正常工作但是当我尝试从远程访问我的 ES 时“ http://IpAddress:9200给了我 CONNECTION REFUSED 也 curl -XGET IPAddress:9200 给了我 CONNECTION REFUSED

这在 ES 1.4 中运行良好,但在 2.X 中它开始给我带来连接问题

4

1 回答 1

1

你有两个解决方案:

A.您可以更改network.bind_host为您的公共IP地址

B. 您删除network.bind_host并仅保留network.host您的公共 IP 地址。后者将同时设置network.bind_host和设置network.publish_host为您的公共 IP 地址。

还要确保删除行首的所有空格。

于 2016-03-11T05:03:12.423 回答