elasticsearch重平衡特定索引分片分布

  elasticserach会自动进行索引及分片的平衡,但有时由于内部策略也会出现某些与主观上不相符的均衡,因此有时需要手工进行下重平衡,命令如下:

POST index_name/_settings
{index.routing.allocation.total_shards_per_node": number}

则会触发集群平衡,最终限定每个节点最多包含该索引的指定数量分片。官网描述如下:

The maximum number of shards (replicas and primaries) that will be allocated to a single node. Defaults to unbounded.

Reference

[1]. Elasticsearch官方文档 shard allocation strategy

你可能感兴趣的:(Elasticsearch)