Elasticsearch 2.2集群:添加节点失败

时间:2016-02-19 15:47:37

标签: elasticsearch

我正在尝试添加第二个节点。因此,我在同一网络中的另一台主机上安装了相同版本的ES(两者之间没有防火墙)。

群集名称是两台主机上的默认名称(" elasticsearch")。

在节点#2上,我将第一个节点的IP添加到elasticsearch.yml:

discovery.zen.ping.unicast.hosts: ["1.2.3.1"]

(也尝试discovery.zen.ping.unicast.hosts: ["127.0.0.1, "1.2.3.1"]

我关闭了所有内容,首先启动节点#1,然后启动节点#2。

节点#1在节点#2出现后很快给出了这个:

[2016-02-19 16:30:06,848][INFO ][rest.suppressed          ] /_bulk Params: {}
ClusterBlockException[blocked by: [SERVICE_UNAVAILABLE/2/no master];]
        at org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedException(ClusterBlocks.java:154)
        at org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedRaiseException(ClusterBlocks.java:144)
        at org.elasticsearch.action.bulk.TransportBulkAction.executeBulk(TransportBulkAction.java:212)
        at org.elasticsearch.action.bulk.TransportBulkAction.doExecute(TransportBulkAction.java:159)

节点#2在发出curl localhost:9200/_cat/health?pretty

时给出了这一点
[2016-02-19 16:30:45,177][INFO ][discovery.zen            ] [Zartra] failed to send join request to master [{Western Kid}{ymbhcgNQR6WrE-zdbrj3QQ}{172.31.32.37}{172.31.32.37:9300}], reason [RemoteTransportException[[Western Kid][172.31.32.37:9300][internal:discovery/zen/join]]; nested: IllegalStateException[Node [{Western Kid}{ymbhcgNQR6WrE-zdbrj3QQ}{172.31.32.37}{172.31.32.37:9300}] not master for join request]; ]

我认为我读到建立一个ES集群是世界上最简单的事情; - )

1 个答案:

答案 0 :(得分:1)

什么是" network.host" elasticsearch.yml上的配置?

如果保留默认配置,则会将其设置为" 127.0.0.1"。

尝试放置network.host: [_site_ , 127.0.0.1]