当我使用postgresql安装sonarqube时,我无法将其连接到Postgresql的jdbc。在/opt/sonarqube/conf
中,我将JDBC取消注释为
sonar.jdbc.username=username
sonar.jdbc.password=password.
2.sonar.jdbc.url=jdbc:postgresql://localhost/username
另外,下面是我取消评论的声纳扫描仪配置 默认的SonarQube服务器
sonar.host.url=http://localhost:9000
PostgreSQL
sonar.jdbc.url=jdbc:postgresql://localhost/username
这是我为配置Postgres DB
所遵循的这是我的日志文件显示
2017.03.08 14:39:13 INFO web [o.sonar.db.Database]为jdbc创建JDBC数据源:postgresql:// localhost / username 2017.03.08 14:39:13 ERROR web [o.a.c.c.C。[。[。[/]]将上下文初始化事件发送到类org.sonar.server.platform.PlatformServletContextListener的侦听器实例的异常 java.lang.IllegalStateException:无法连接到数据库。请检查连接和设置(请参阅' sonar.jdbc。'前缀的属性)。 在org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:104)〜[sonar-db-5.6.6.jar:na]
我是否需要为Postgresql的JDBC连接做任何其他事情。是否有任何文件可供sonarqube用于postgresql。
答案 0 :(得分:0)
这对我来说很有用
[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