master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster

在部署 ElasticSearch7.13.4,启动节点时报错:

[2021-11-11T11:55:03,704][WARN ][o.e.c.c.ClusterFormationFailureHelper] 
[es_192.168.16.143_9253] master not discovered yet,this node has not previously joined a bootstrapped (v7+) cluster,
and this node must discover master-eligible nodes [
    es_192.168.16.90_9253,
es_192.168.16.143_9253,
es_192.168.17.15_9253,
es_192.168.16.154_9253,
es_192.168.16.139_9253,
es_192.168.16.87_9253,
es_192.168.16.98_9253] to bootstrap a cluster:
have discovered [
{es_192.168.16.143_9253}{iqIiy9v3QEy486Mokda1JQ}{uraxlZ4pQTmauo2PYeyi8A}{192.168.16.143}{192.168.16.143:9353}{m},
{es_192.168.17.15_9253}{ehhbV1L4Sd6q4iEHD2ZXgw}{CsRqqbF5SDizhu8sMnk_mw}{192.168.17.15}{192.168.17.15:9353}{m},
{es_192.168.16.90_9253}{W2Syx-M1Tf2wOXJzcwIpuw}{azVBifMUTPyHTiOkKxGEGw}{192.168.16.90}{192.168.16.90:9353}{m}];
discovery will continue using [192.168.16.90:9353, 192.168.17.15:9353] from hosts providers and [{es_192.168.16.143_9253}{iqIiy9v3QEy486Mokda1JQ}{uraxlZ4pQTmauo2PYeyi8A}{192.168.16.143}{192.168.16.143:9353}{m}] from last-known cluster state; node term 0, last-accepted version 0 in term 0

报错解析:

  master节点还没选举出来,原因就是 在 master-eligible nodes 列表里的节点,必须有 N/2+1 个节点已启动才能进行选举出 master 

    也就是说:1.master节点启动个数不够 2. 节点启动了但是角色不是master 

我这个里的报错原因:

配置文件中初始的master列表(3个master)
cluster.initial_master_nodes: []

配置文件中集群中所有节点列表(总共7个节点:3-master、2-data、2-coordinating)
discovery.seed_hosts:[]

我把上面的量参数值,写反了,导致有启动时认为有7个master,虽然所有节点都启动了,但是实际上就3个master,4个非master节点

  

总结:

  遇到 master not discovered yet 这种报错,不要慌,基本都是自己的配置或启动问题导致的

  

远方不一定有诗,但有更好的自己!你我共勉!
原文地址:https://www.cnblogs.com/cuisi/p/15540095.html