AnSahar
AnSahar

Reputation: 41

Connect Sonarqube 6.7 to external Elasticsearch

I've been using Sonarqube with its embedded database for demos. Now, I need to connect it to an external Elasticsearch instance to meet the requirements of a production environment.

Which configurations I have to add on the elasticsearch.yml and sonar.properties?

Upvotes: 4

Views: 3798

Answers (2)

Miao1007
Miao1007

Reputation: 974

I succeed to use a external ElasticSearch with latest sonarqube 8.9. But it's just a hack at your own risk.

Steps

Create a elastic search server

First start a elastic search instance anywhere.

Modify the config files

Modify the file

cat >> conf/sonar.properties < EOF
# your external host and port
sonar.search.port=9200
sonar.search.host=192.168.xx.xx
EOF
# create a dummy run script
cat > elasticsearch/bin/elasticsearch << EOF
#!/bin/bash
# it's a inflate sleep
cat
EOF

Run sonarqube

just start sonarqube and view indexs in your new elasticsearch.

Upvotes: 2

G. Ann - SonarSource Team
G. Ann - SonarSource Team

Reputation: 22804

For the move to production, you don't need to, and shouldn't try to connect to an external Elasticsearch instance. SonarQube starts up and manages its own instance internally.

What you do need to do is connect to an external database, and that's easily done by setting the correct properties in $SONARQUBE_HOME/conf/sonar.properties

Upvotes: 5

Related Questions