通过执行 GET /_cluster/allocation/explain 查看当前索引分配详情
"deciders": [{
"decider": "shards_limit",
"decision": "NO",
"explanation": "too many shards [1] allocated to this node for index [index-xxx], index setting [index.routing.allocation.total_shards_per_node=1]"
}]
如果 decider 中返回 shards_limit,通常是由于配置了单节点可分配分片数达到上限而无法分配。
执行 GET /{myIndex}/_settings 查看 index.routing.allocation.total_shards_per_node 配置的具体值,需要保证该值大于等于((主分片数+副本分片数)/ 节点数),如果该值小于会导致部分分片无法分配
修改单节点可分配分片数大小大于(主分片数+副本分片数)/ 节点数,或-1(不限制数量)
PUT /{myIndex}/_settings
{
"index.routing.allocation.total_shards_per_node": -1
}
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。