elastic search中的索引分片重新分配

https://www.elastic.co/guide/en/elasticsearch/reference/7.9/delayed-allocation.html

索引分片重新分配是指的什么呢?

正常情况下一个索引的分片肯定会最终分配在一个node上,但是当这个node网络中断,无法与集群保持心跳后,es集群为了保证数据不丢失,就要进行索引重新分配的动作。

比如node 5 失联,在这个时候

对于所有主分片在node 5上的索引,master节点会将索引的副本分片变为主分片

master节点分配新的副本分片在集群的其他node上。这些新的副本分片是主分片的完全拷贝。

集群达到一个新的平衡。

当node 5又回到了集群,master节点再把node 5 当做一个新节点在上面重新分配分片。

如果你想控制某一个分片最终分配在哪里,就要理解allocation filter .

https://www.elastic.co/guide/en/elasticsearch/reference/7.9/shard-allocation-filtering.html

不过我个人觉得这种强行改变es内部机制的操作,真正用到的比较少

猜你喜欢

转载自blog.csdn.net/weixin_39394909/article/details/108690640
今日推荐