flood stage disk watermark [95%] exceeded ... all indices on this node will be marked read-only

时间:2022-05-26
本文章向大家介绍flood stage disk watermark [95%] exceeded ... all indices on this node will be marked read-only,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

最近遇到了一个问题,想登录测试环境的kibana查看一下近期的日志情况,但是发现近一周并没有日志显示,查看elasticsearch的日志时发现了以下报错:

[node-1] flood stage disk watermark [95%] exceeded on [JI43BoeFR8G8Q5oUYW2uXg][node-1][/usr/local/elasticsearch-7.1.0/data/nodes/0] free: 7.7gb[4.9%], all indices on this node will be marked read-only

这是说磁盘使用率超过阈值95%,所以es索引模式变成只读,无法写入数据,从而导致kibana没有数据显示。

针对该问题,有两种解决办法:

  • 1.清理磁盘空间
    因为elasticsearch会对磁盘空间进行监控,当磁盘剩余空间达到了flood stage阈值,会将所有的相关索引强制设置为只读。需要清理磁盘空间后,才能写入数据。
    具体的清理办法可以参考我的这篇博客:https://www.cnblogs.com/even160941/p/16313449.html

  • 2.调整elasticsearch的默认阈值
    /config/elasticsearch.yml文件中增加如下配置:

cluster.routing.allocation.disk.watermark.low: 90%
cluster.routing.allocation.disk.watermark.high: 95%
cluster.routing.allocation.disk.watermark.flood_stage: 97%

cluster.routing.allocation.disk.watermark.low: 100gb
cluster.routing.allocation.disk.watermark.high: 50gb
cluster.routing.allocation.disk.watermark.flood_stage: 10gb

其中:

cluster.routing.allocation.disk.watermark.low,默认85%,用于控制磁盘的最小使用率;cluster.routing.allocation.disk.watermark.high,默认90%,用于控制磁盘的最大使用率;cluster.routing.allocation.disk.watermark.flood_stage,默认95%,超过此值时,Elasticsearch 变成只读模式,无法写入数据。

注:上述配置必须同时设为百分比,或具体字节值,不能混用。

原文地址:https://www.cnblogs.com/even160941/p/16315259.html