Search code examples
powershellelasticsearchsonarqube

Configuring Elasticsearch


I'm part way through adoption of sonarqube which has hit an intermittent issue relating to the Elasticsearch instance it relies on. To resolve this I believe I need to modify an Elasticsearch config value.

In the \conf\sonar.properties settings file I have set

sonar.search.port=9200

which gives me the following when I try to access in a browser.

enter image description here

Great so I just need to construct the right request in powershell?

Invoke-WebRequest 'localhost:9200' -Method 'GET' URI prefix not recognised
Invoke-WebRequest 'http://localhost:9200/' -Method 'GET' Protocol Violation
Invoke-WebRequest 'localhost:9200' -Method 'XGET' Cannot convert value "XGET" to type
Invoke-WebRequest 'http://localhost:9200/_all/settings' -Method 'GET' Protocol Violation

If I change the Elasticsearch config directly it gets regenerated (as part of the sonar startup perhaps) so I think any config must be done this way.

Any pointers would be appreciated.


Solution

  • The sonar documentation is really lacking. The correct sonar setting for the port is:

    sonar.search.httpPort=9200