[2019-10-19T07:15:06,563][WARN ][o.e.c.r.a.DiskThresholdMonitor] [DESKTOP-5HVG8OJ] flood stage disk
watermark [95%] exceeded on [zp5VCpgeRIqwUMf_8VSXyQ][DESKTOP-5HVG8OJ]
[D:\MT_20160502\BWHYE-20190430\04_DEVELOPMENT\dev_tool\elk\elasticsearch-7.4.0\data\nodes\0]
free: 7.4gb[1.5%], all indices on this node will be marked read-only
自己的磁盘快满了,但是还有10多g,但是es就一直在warning,把index设置成了read only
在StackOverflow上搜到了解决方案,方式如下:
# /etc/elasticsearch/elasticsearch.yml
cluster.routing.allocation.disk.threshold_enabled: true
cluster.routing.allocation.disk.watermark.flood_stage: 5gb
cluster.routing.allocation.disk.watermark.low: 30gb
cluster.routing.allocation.disk.watermark.high: 20gb
但是,对于watermark这几个参数也不知道啥意思,谁有原理可以解释一下?
cluster.routing.allocation.disk.threshold_enabled 是否启用功能
cluster.routing.allocation.disk.watermark.low 到达就停止创建新shards
cluster.routing.allocation.disk.watermark.high 到达后会迁移现有shards到其他节点
cluster.routing.allocation.disk.watermark.flood_stage 到达后节点数据无法写入
总的来说就是保护节点磁盘不会写满导致数据丢失或损坏。