行动是治愈恐惧的良药,而犹豫、拖延将不断滋养恐惧。

es mater挂了,在进行master选举期间,能正常写入吗?能正常查询吗?

Elasticsearch | 作者 sterne vencel | 发布于2018年05月30日 | 阅读数:4702

将ES的master节点关闭后,设置的是60s后进行master的选举,这60s内索引操作会受到影响吗?查询操作会受到影响吗?
背景:ES版本5.6, 具备master选举资格的节点为3个,有专门提供请求的client节点。
自己测试的结果:当把master节点停掉后,向索引中插入文档出现等待的情况(一直没有返回值)。也并没有出现500的返回值。
 
 
已邀请:

kennywu76 - Wood

赞同来自: exceptions jianjianhe

默认的设置情况下,没有新master选举出来之前,集群查询请求可以正常进行,但是写入会被block。

yayg2008

赞同来自:

默认是1分钟超时,所以你的等待应该就是1分钟。
官方说明:
Timeoutedit
The primary shard assigned to perform the index operation might not be available when the index operation is executed. Some reasons for this might be that the primary shard is currently recovering from a gateway or undergoing relocation. By default, the index operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error. The timeout parameter can be used to explicitly specify how long it waits. Here is an example of setting it to 5 minutes:
https://www.elastic.co/guide/e ... .html

jianjianhe

赞同来自:

这个问题我前阵子也遇到了,一时没时间深入研究,感谢楼主提出来,并且得到了很好的回复,也让我学习了一波!

要回复问题请先登录注册