[Question] SonarQube + Docker - How to apply custom settings in elasticsearch.yml?

Hi there,

I’m using SonarQube 8.6 community as a docker container.
The host has a disk capacity of 3 TB of which ~ 230GB are free.

However, sonar / elasticsearch is complaining every minute:

2020.12.27 00:00:46 WARN  es[][o.e.c.r.a.DiskThresholdMonitor] high disk watermark [90%]
exceeded on [_XXXX][sonarqube][/opt/sonarqube/data/es7/nodes/0] free:
228.9gb[8.5%], 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

What I’m tring to achieve

Turn those warnings off

What I’ve tried so far to achieve this

According to the documentation, I need to set cluster.routing.allocation.disk.threshold_enabled: false

in /opt/sonarqube/elasticsearch/config/elasticsearch.yml

So I’ve created a elasticsearch.yml on the host system and mounted it to the container:
/docker/sonarqube/data/conf/elasticsearch.yml --> /opt/sonarqube/elasticsearch/config/elasticsearch.yml

However, the warning still shows up in the es.log.

According to my understanding /opt/sonarqube/temp/conf/es/elasticsearch.yml should show my modification too. But this is not the case:

# This file has been automatically generated by SonarQube during startup.


http.cors.allow-origin: '*'
cluster.name: sonarqube
cluster.routing.allocation.awareness.attributes: rack_id
http.port: '9001'
node.attr.rack_id: sonarqube
http.cors.enabled: 'true'
path.logs: /opt/sonarqube/logs
bootstrap.system_call_filter: 'false'
transport.port: '32854'
node.master: 'true'
path.data: /opt/sonarqube/data/es7
node.name: sonarqube
network.tcp.reuse_address: 'true'
discovery.initial_state_timeout: 30s
node.data: 'true'
action.auto_create_index: 'false'

Can anyone tell me please how to apply my configuration?

Thanks and best regards

Hello @Karl_Itsch and welcome to the community :wave:

As you can read from the comment of this file, these settings should not be edited as they are overwritten during startup. as far as i know you can work around your issue with specifying the requested property as a jvm argument for elasticsearch.

in sonar.properties:


could you reference that docs that you were following? i can not find a mention of elasticsearch.yml in our docs