面对相同的问题,即节点无法在节点重新启动时选举主节点。
问题在于节点之间的通信。
请确保在elasticsearch日志中,节点重启是否显示
publish_address {127.0.0.1:9200}
or
publish_address {0.0.0.1:9200}
这意味着当前节点未将其IP地址发布给其他节点,因此即使该节点IP可能存在于 *
在elasticsearch.yml中进行以下更改。加
network.host: _non_loopback:ipv4_
and restart the node.
Ensure that the bound address Now shows the <IP address>:<port no> and not the localhost.
这意味着现在您的节点是可发现的。使它在群集中可发现的第二步是将节点的ip地址添加到所有主节点的单播主机列表中,以便每当我们有一个新的主节点时,新的主节点就可以发现该节点。
Add the node IP to the discovery.zen.ping.unicast.hosts
list of hosts of all the masters to make it disoverable. A masterpings all the
nodes present in the unicast list.