No known master node問題

滄南發表於2017-03-01

ES叢集重啟一個節點後,該節點無法加入叢集,報錯資訊:

[2017-02-14 14:35:31,868][ERROR][marvel.agent.exporter    ] [es-06] error adding the marvel template to [[0:0:0:0:0:0:0:0]:9200] response code [503 Service Unavailable]. content: [{"error":"MasterNotDiscoveredException[waited for [30s]]","status":503}]
[2017-02-14 14:35:31,868][ERROR][marvel.agent.exporter    ] [es-06] failed to verify/upload the marvel template to [[0:0:0:0:0:0:0:0]:9200]:Server returned HTTP response code: 503 for URL:http://[0:0:0:0:0:0:0:0]:9200/_template/marvel]

修改配置檔案 elasticsearch.yml

network.host: 該節點IP

報錯資訊:

[2017-02-14 14:46:56,012][DEBUG][action.admin.indices.template.put] [es-06] observer: timeout notification from cluster service. timeout setting [30s], time since start [30s]
[2017-02-14 14:46:56,014][ERROR][marvel.agent.exporter] [ies-06] error adding the marvel template to [該節點IP:9200] response code [503 Service Unavailable]. content: [{"error":"MasterNotDiscoveredException[waited for [30s]]","status":503}]
[2017-02-14 14:46:56,014][ERROR][marvel.agent.exporter] [es-06] failed to verify/upload the marvel template to [該節點IP:9200]:Server returned HTTP response code: 503 for URL: http://該節點IP:9200/_template/marvel
[2017-02-14 14:46:56,014][ERROR][marvel.agent.exporter] [es-06] could not connect to any configured elasticsearch instances: [該節點IP:9200]
[2017-02-14 14:47:06,019][DEBUG][action.admin.indices.template.get] [es-06] no known master node, scheduling a retry

接著修改:

discovery.zen.ping.unicast.hosts: ["IP1", "IP2",...]

日誌正常:

[2017-02-14 14:49:32,032][INFO ][node] [es-06] starting ...
[2017-02-14 14:49:32,204][INFO ][transport] [es-06] bound_address {inet[/該節點IP:9300]}, publish_address {inet[/該節點IP:9300]}
[2017-02-14 14:49:32,214][INFO ][discovery ] [es-06] elasticsearch/PF6CtX38STGjc6D-******
[2017-02-14 14:50:02,215][WARN ][discovery] [es-06] waited for 30s and no initial state was set by the discovery
[2017-02-14 14:50:02,256][INFO ][http] [es-06] bound_address {inet[/該節點IP:9200]}, publish_address {inet[/該節點IP:9200]}
[2017-02-14 14:50:02,257][INFO ][node] [es-06] started
[2017-02-14 14:50:09,939][INFO ][cluster.service] [es-06] detected_master [es-08]

相關文章