2

我在 RHEL6.2 服务器上有 sonarqube 3.5.1 和 sonar-runner 2.2.1,sonar-runner 可以很好地处理我下载的示例数据。

但是,我已将 sonar-runner 部署到 Windows 客户端,但它无法连接到 H2 数据库。

INFO: Sonar Server 3.5.1
11:58:19.960 INFO  - Load batch settings
11:58:20.116 INFO  - User cache: C:\Users\e01942082\.sonar\cache
11:58:20.132 INFO  - Install plugins
11:58:21.739 INFO  - -------------  Executing Project Scan
11:58:22.113 INFO  - Install JDBC driver
11:58:22.129 INFO  - Apply project exclusions
11:58:22.129 WARN  - H2 database should be used for evaluation purpose only
11:58:22.129 INFO  - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 8.393s
Final Memory: 2M/15M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to connect to database
ERROR: Caused by: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-167])
ERROR: Caused by: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-167]
ERROR: Caused by: Connection refused: connect

所以,我已经更新了 sonarqube 中的声纳属性

# Comment the following line to deactivate the default embedded database.
sonar.jdbc.url:                            jdbc:h2:tcp://gbrpsr000000711.xxxxxxxxx.xxxxxxxxxxx.com:9092/sonar
sonar.jdbc.driverClassName:                org.h2.Driver

和 sonar-runner 连接到服务器

sonar.host.url=http://gbrpsr000000711.xxxxxxx.xxxxxxxx.com:9000/sonar

不清楚为什么它选择本地主机而不是服务器的完整 url。在进行配置更改之前启动服务时,我是否遗漏了某些内容/或者是否已嵌入此内容????

谢谢你的帮助

dd

4

0 回答 0