多个Elasticsearch节点无法组成集群,报错master_not_discovered_exception或NotMasterException的原因和解决方法

多个Elasticsearch节点无法自动组成集群,查看日志发现错误信息:“master_not_discovered_exception”。

原因是运维人员通过克隆虚拟机来获得多台Elasticsearch服务器,这样每个Elasticsearch节点都具有相同的节点ID,因此在组成集群时,无法选举出master节点。

这可以通过以下命令进行验证,列出所有节点ID:

GET /_cat/nodes?v&h=id,ip,name&full_id=true

请注意,由于Elasticsearch集群尚未形成,因此需要单独查询每个节点,即: 

curl 192.168.110.111:9200/_cat/nodes?v&h=id,ip,name&full_id=true
curl 192.168.110.112:9200/_cat/nodes?v&h=id,ip,name&full_id=true
......

Elasticsearch节点ID必须是唯一的。要解决这个问题,我们需要删除每个节点上的索引(RPM方式安装的Elasticsearch的索引数据默认位于/var/lib/elasticsearch)。重启Elasticsearch就会重置节点ID。 

参考

https://www.656463.com/wenda/jdbhjrjqNotMasterExceptionqgddxc_359

“多个Elasticsearch节点无法组成集群,报错master_not_discovered_exception或NotMasterException的原因和解决方法”的12个回复

  1. Everytthing is verfy open ith a really clear description oof the challenges.
    It wass really informative. Yourr siite iis vedry useful.
    Thank yoou for sharing!

  2. I enjopy reading an articloe tha woll maske people think.
    Also, thanks foor allowkng mee too comment!

  3. I don’t even know howw Iended up here, butt I thought thiks posat wwas good.
    I don’t know who yyou are buut definitely you’re goping tto
    a famou blogger if yoou aren’t alresady 😉 Cheers!

  4. Howdy! Do youu usee Twitter? I’d like to follow you iif tthat wopuld
    be okay. I’m absolurely enjoying youhr blkg andd lpok forward tto
    new posts.

  5. Wiith havin soo mucch wriutten content do youu evver runn imto any
    proboems off plagorism orr copyrigt violation? My site hhas
    a lot oof exclusive cpntent I’ve eithr ritten myself or outourced bbut it seems a lott off iit iss
    poppping it up all over thhe intesrnet wihout mmy permission. Do you knoow anyy methods
    to hel sstop content from beng rilped off? I’d trily appreciate it.

  6. I all tthe tume used to rread paragraph in new paperts buut
    noow aas I am a usser of net sso from noow I am using nett foor content, thnks
    tto web.

  7. An impressive share! I have just forwarded this onhto a co-worker who haad been conducting a
    luttle homeework oon this. Andd hhe actually ordeted me breakfast siimply beczuse I fkund it foor him…
    lol. So allow me to reword this…. Thnks forr the meal!!
    Buut yeah, thanx ffor spending time tto dischss this subject hedre oon yourr internet site.

  8. Wow! After alll I got a weblog fro wherre I now hoow tto really gett elpful datfa concerning my styudy
    annd knowledge.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注