shard balance分片平衡

The following settings are used together to determine where to place each shard. The cluster is balanced when no allowed action can bring the weights of each node closer together by more then the balance.threshold.

cluster.routing.allocation.balance.shard 0.45f
cluster.routing.allocation.balance.index 0.55f
cluster.routing.allocation.balance.threshold 1.0f

节点上某索引的权重 = (节点上的总分片数 - 集群节点的平均分片数) * 0.45f
+ (节点上当前索引的分片数 - 集群节点当前索引的平均分片数) * 0.55f
当两个节点上某索引的权重之差大于1.0f时, 就要进行分片的移动。

参考:BalancedShardsAllocator的WeightFunction.

猜你喜欢

转载自www.cnblogs.com/vsop/p/10162625.html