SonarQube 8.5 的 PostgreSQL 连接失败

PostgreSQL connection failure with SonarQube 8.5

我已经在 CentOS 7 系统上安装了 SonarQube 8.5,它在我设置 PostgreSQL 9.6 连接(然后是嵌入式数据库)之前启动。 所以我继续:

sonar.jdbc.username=sonar
sonar.jdbc.password=####
...
sonar.jdbc.url=jdbc:postgresql://localhost/sonar

这就是我 /var/lib/pgsql/data/pg_hba.conf

中的内容
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
# "local" is for Unix domain socket connections only
local   all         all                               md5
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

自从我添加了数据库(名为“sonar”)连接后,它失败了,没有任何有用的日志。只有那些:

2020.11.06 13:47:16 WARN es[][o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.

2020.11.06 13:47:25 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143

2020.11.06 13:47:24 WARN web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [elasticsearch[client][[timer]]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@11.0.8/java.lang.Thread.sleep(Native Method)\n app//org.elasticsearch.threadpool.ThreadPool$CachedTimeThread.run(ThreadPool.java:574)

所以我尝试在此处修复和测试数据库帐户:

ALTER USER sonar WITH ENCRYPTED PASSWORD '####';
ALTER ROLE
...
psql -d "postgresql://sonar:####@localhost/sonar" -c "select now()"
psql: FATAL:  Ident authentication failed for user "sonar"

注意:作为 ROOT 用户和 POSTGRES 用户,我一直在使用和不使用加密进行尝试……但没有成功。

请参阅上面的评论以了解配置修复。首先,Centos OS 7 中 yum 的默认 PG 版本甚至都不正确。