Reputation:
When I am installing sonarqube using postgresql, I got stuck with connecting it to jdbc of Postgresql. In /opt/sonarqube/conf
, I uncommented JDBC as
sonar.jdbc.username=username
sonar.jdbc.password=password.
2.sonar.jdbc.url=jdbc:postgresql://localhost/username
Additionally, below is my sonar scanner conf that I uncommented Default SonarQube server
sonar.host.url=http://localhost:9000
PostgreSQL
sonar.jdbc.url=jdbc:postgresql://localhost/username
This is what I followed for configuring Postgres DB
This is my log file shows
2017.03.08 14:39:13 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://localhost/username 2017.03.08 14:39:13 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.'). at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:104) ~[sonar-db-5.6.6.jar:na]
Is there any other thing that I need to do for JDBC connection of Postgresql. is there is any document available for sonarqube for postgresql.
Upvotes: 3
Views: 7177
Reputation:
This got worked out for me
[root@sonarqube ~]# egrep "^local|^host" /var/lib/pgsql/9.5/data/pg_hba.conf
uncomment below lines in pg_hba.conf
local all all md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
Upvotes: 2