I'm trying to run SonarQube on a server with ~2TB disk space, and only ~50G free space. When trying to use docker as in the official manual (nothing special), elasticsearch fails with a message about the read-only index. As far as I can get, this happens because it hits the flood_stage
watermark, which is set to 95% by default. I'm pretty sure that we can set this watermark (and all others) to non-percentage smaller values, but I can't seem to find the configuration file, which the embedded elasticsearch is using. I've tried /opt/sonarqube/conf/elasticsearch.yml
(which did not exist, needed to create it) and /opt/sonarqube/elasticsearch/config/elasticsearch.yml
, which contained the default elasticsearch configuration.
Even when writing complete non-yml gibberish into these files, elasticsearch fails with the same error, so I'm pretty sure that these are not the files that are in use. I have also tried to search through the documentation, but it seems that the only hint it contains about this behaviour is "increase the disk space, and delete all indexes". So, what files should I use to configure embedded elasticsearch?
UPD: We have ended up monkey-patching the /opt/sonarqube/elasticsearch/bin/elasticsearch
startup script to insert additional lines into the dynamically generated config (which is located in /opt/sonarqube/temp/conf/es/elasticsearch.yml
btw). Not a clean solution, but this seems to be the simplest, considering how sonarqube generates the config dynamically
for changing watermark setting, you can use dynamic cluster update setting: https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html
for watermark, something like this: