背景:
今天打开Kibana发现没有数据,并且Stack Monitor 打开没有东西
于是查看ElasticSearch的日志。报错如下:
分析:
ElasticSearch 7.x 如果没有配置 cluster.max_shards_per_node
,默认的分片数是1000,从上图可以看出,是分片数限制不足导致的。
解决
通过请求ELasticSearch的接口,增大分片数限制
curl -XPUT -H"Content-Type:application/json" -d'{"transient":{"cluster":{"max_shards_per_node":10000}}}' -u elastic:xxoo 'http://localhost:9200/_cluster/settings'
然后再看日志,恢复正常了