Ubuntu 14 声纳6.7.1 Postgresql 9.5 Java(TM)SE运行时环境(版本1.8.0_144-b01)
Sonarqube没有运行Web UI,但声纳服务处于活动状态。你可以帮帮我吗 java.net.UnknownHostException:localhost
/opt/sonarqube-6.7.1/logs/web.log
ERROR web[][o.postgresql.Driver] Connection error:
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:275)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194)
at org.postgresql.Driver.makeConnection(Driver.java:450)
at org.postgresql.Driver.connect(Driver.java:252)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.pool.impl.GenericObjectPool.addObject(GenericObjectPool.java:1617)
at org.apache.commons.pool.impl.GenericObjectPool.ensureMinIdle(GenericObjectPool.java:1575)
at org.apache.commons.pool.impl.GenericObjectPool.access$700(GenericObjectPool.java:190)
at org.apache.commons.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1709)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.net.UnknownHostException: localhost
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.postgresql.core.PGStream.<init>(PGStream.java:68)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:144)
/opt/sonarqube-6.7.1/logs/sonar.log
2018.01.31 16:37:21 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube-6.7.1/temp
2018.01.31 16:37:21 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.01.31 16:37:21 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube-6.7.1/elasticsearch]: /opt/sonarqube-6.7.1/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonarqube-6.7.1/temp/conf/es
2018.01.31 16:37:21 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.01.31 16:37:21 INFO app[][o.e.p.PluginsService] no modules loaded
2018.01.31 16:37:21 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.01.31 16:37:35 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2018.01.31 16:37:35 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube-6.7.1]: /usr/lib/jvm/jdk1.8.0_144/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube-6.7.1/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttp.auth.ntlm.domain= -DsocksProxyHost= -DsocksProxyPort= -Dhttps.proxyHost= -Dhttps.proxyPort= -cp ./lib/common/*:./lib/server/*:/opt/sonarqube-6.7.1/lib/jdbc/postgresql/postgresql-42.1.4.jar org.sonar.server.app.WebServer /opt/sonarqube-6.7.1/temp/sq-process3048603911980736431properties
2018.01.31 16:40:27 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.01.31 16:40:27 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.01.31 16:40:27 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
2018.01.31 16:40:27 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
Sonar.properties config
sonar.jdbc.username=sonarqube
sonar.jdbc.password=sonarqube
sonar.jdbc.url=jdbc:postgresql://localhost/sonar
sonar.web.host=0.0.0.0
sonar.web.port=9000
答案 0 :(得分:0)
我找到了解决方案,问题是在sonar lib的驱动程序jdbc中为posrgesql。版本42.1.6不起作用。我下载了42.2.1并用ver更改了名称。 &#34; ... 42.1.6.jar&#34 ;.是的,这是错的,但它的工作。
答案 1 :(得分:0)
在连接postgres db的过程中,我也遇到了错误消息,升级了org.postgresqlpostgresql
依赖项后,我的问题已成功解决