Elasticsearch报错:
this cluster currently has [1946]/[1000] maximum shards open
原因:
ElasticSearch 7.x 如果没有配置 cluster.max_shards_per_node
,默认的分片数是1000。
方法:
1、控制台
PUT /_cluster/settings
{
"transient": {
"cluster": {
"max_shards_per_node":10000
}
}
}
2、修改配置文件
# vim elasticsearch.yml
cluster.max_shards_per_node: 10000
3、shell命令
curl -XPUT -H"Content-Type:application/json" -d'{"transient":{"cluster":{"max_shards_per_node":10000}}}' -u elastic:xxoo 'http://localhost:9200/_cluster/settings'