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'