Even after reading the docu I have no idea what to set to my "elasticsearch.yml" file to prevent the following pain which I am getting all at the same time:
low disk watermark [20gb] exceeded on ...
high disk watermark [10gb] exceeded on ...
flood stage disk watermark [5gb] exceeded on ...
My hard disk has 25 GB of free space available and is at 93%.
If so, the settings you quote look correct. Can you share the log messages you're seeing indicating that the disk-based shard allocator is causing a problem?
[2019-02-10T05:32:43,078][WARN ][o.e.c.r.a.DiskThresholdMonitor] [Ql8wRCh] flood stage disk watermark [5gb] exceeded on [Ql8wRChKRb-YoZ0gz0nBDA][Ql8wRCh][/var/lib/elasticsearch/nodes/0] free: 2.4gb[0.8%], all indices on this node will be marked read-only
This indicates that you have substantially less free space than you think. Can you run df and see if it agrees with these numbers?
Is Elasticsearch still running and reporting a lack of space every 30 seconds? The timestamp on the last log message you shared looks several hours old (or maybe is in a different timezone).
This however makes me think that it is a temporary space shortage at night, when I do backups. Hmm ... let me change something and get back here tomorrow.
That sounds about right. Something (possibly Elasticsearch, possibly another process) is consuming nearly all your disk space and then releasing it again. Elasticsearch is rather averse to running out of disk space, so when you exceed the flood_stage watermark it takes the fairly drastic step of marking everything as read-only to protect itself.
In the long run you will need more disk space. You may be able to work around this in the short term by isolating Elasticsearch on its own filesystem (assuming it's not Elasticsearch that's consuming all the disk). If desperate you can set the flood_stage watermark to something tiny (e.g. 100mb).
Things cannot be solved on my server since even after tweaking there is not enough disk space left to avoid high and low disk watermark warnings/issues. I need to get a bigger volume with sufficient space.
However setting flood_stage to a much lower value for the time being helps preventing the rerouting of shards from being stopped entirely due to locking down the disk for Elasticsearch:
Elasticsearch actually needs quite a lot for disk space to do replication so the requirements in GB suggested for high and low disk watermarks do need to be met. If you have disk space galore one can use settings with percentages and if you are tight in disk space you need to set hard values in gb.
@DavidTurner Thanks a lot for guiding me through my troubled waters. This is very much appreciated!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.