简体   繁体   中英

PostgreSQL connection failure with SonarQube 8.5

I've installed SonarQube 8.5 over a CentOS 7 system and it started before I set up a PostgreSQL 9.6 connection (with embedded database, then). So I moved on:

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

This is what I've got in my /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

Since I added the database (named "sonar") connection, it failed with no helpful logs. Only those:

2020.11.06 13:47:16 WARN es[][oedcsSettings] [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[][osapAbstractManagedProcess] Process exited with exit value [es]: 143

2020.11.06 13:47:24 WARN web[][oaclWebappClassLoaderBase] 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)

So I tried to fix and test the database account here:

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"

NB: I've been trying it with AND without encryption, as ROOT user and POSTGRES user... but no luck.

See comments above for configuration fix. In the first place, the default PG version from yum in Centos OS 7 wasn't even right.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM