节点未加入 Elasticsearch 5.1 集群中的集群

Nodes not joining cluster in Elasticsearch 5.1 cluster

我想使用 Elasticsearch 5.1.1 设置一个包含 3 个节点(1 个主节点、1 个客户端和 1 个数据节点)的集群。我通过无线网络连接了3 windows 10台机器,并编辑了每个节点的elasticsearch.yml文件如下:

主节点:

cluster.name: searchapp

node.name: es-master-01
node.master: true
node.data: false
node.ingest: false

network.host: 192.168.1.3

discovery.zen.ping.unicast.hosts: ["es-client-01", "es-master-01",  "es-data-01"]

客户端节点:

cluster.name: searchapp

node.name: es-client-01
node.master: false
node.data: false
node.ingest: true

network.host: 192.168.1.4

discovery.zen.ping.unicast.hosts: ["es-client-01", "es-master-01",  "es-data-01"]

数据节点:

cluster.name: searchapp

node.name: es-data-01
node.master: false
node.data: true
node.ingest: false

network.host: 192.168.1.2

discovery.zen.ping.unicast.hosts: ["es-client-01", "es-master-01",  "es-data-01"]

当我尝试 运行 主节点上的 elasticsearch 时,它给出了以下输出

节点没有加入集群,我尝试将主机名替换为 IP,但节点仍然没有加入。

根据附加的日志,您的 elasticsearch 集群似乎无法解析机器的主机名。

我建议将所有主机名添加到主机文件中,以便每台机器都知道如何解析主机名。

对于linux:

/etc/hosts

对于windows:

%SystemRoot%\System32\drivers\etc\hosts

默认情况下,%SystemRoot% 表示:C:\Windows