es创建索引错误:

ValidationFailed:1:thisactionwouldadd[2]totalshards,butthisclustercurrentlyhas[1001]/[1000]maximumshardsopen

用的7版本以上的elasticsearch吧,默认只允许1000个分片,问题是因为集群分片数不足引起的。现在在elasticsearch.yml中定义

>cluster.max_shards_per_node:10000
貌似也不生效,默认就允许创建1000个分片,在kibana的tools中改变临时设置
PUT/_cluster/settings
{
"transient":{
"cluster":{
"max_shards_per_node":10000
}
}
}
这样就生效了

或者直接用命令行:

curl-XPUT-H"Content-Type:application/json"-d'{"transient":{"cluster":{"max_shards_per_node":10000}}}''http://localhost:9200/_cluster/settings'

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐