问题现象
selenium定时截图kibana,但是发现数据连续几天都是一样的,感觉好久没有更新了一样,怀疑是查询有问题,尝试登录kibana手动执行查询,但有如下报错:
排查经过
排查了kibana,logstash日志中有报错,但都没有明显的相关内容,那只能继续排查elasticsearch日志,在日志文件logcheck.log中发现了明显的异常:
[2022-05-30T14:20:24,401][WARN ][o.e.c.r.a.DiskThresholdMonitor] [lognode1] high disk watermark [90%] exceeded on [1__xs753R3uOME1Sugp4kg][lognode1][/data/elfk/els/data/nodes/0] free: 181gb[5.1%], shards will be relocated away from this node; currently relocating away shards totalling [0] bytes; the node is expected to continue to exceed the high disk watermark when these relocations are complete
可以看到告警提示高水位线90%,于是我们查询服务器磁盘空间,确实目录使用率已经超过了90%了。清理空间后解决。
感悟
这个问题一开始的提示太模糊了,以致于我们排查了整个elfk日志才能定位,而且如果我们只是排查服务器性能,那么90%+的空间使用率也算正常,无法直接显示出问题在哪里,最后要么对elasticsearch特性很熟悉,要么对els故障排查熟悉,否则还是需要耗费一定时间的。
最后我们看看els关于空间的说明:
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#disk-based-shard-allocation