Unable to connect JDBC to sonarqube using Postgresql

和自甴很熟 提交于 2019-12-13 16:18:58

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/42681411/unable-to-connect-jdbc-to-sonarqube-using-postgresql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!