使用 Sonarqube-4.5.1 无法在 http://localhost:9000 访问 SonarQube 服务器

Ash*_*Ash 5 linux maven sonarqube

我最近在我的 linux 机器( x86_64 x86_64 x86_64 GNU/Linux )上设置了 Sonarqube-4.5.1。
我可以用./sonar.sh start命令启动声纳。在使用./sonar.sh status命令检查声纳状态时,它说SonarQube is running (18493)但是当我尝试打开仪表板 url 时,http://ip-address:9000它在浏览器上显示“连接被拒绝”消息。

在运行mvn sonar:sonar -Dsonar.host.url=http://localhost:9000命令时,我收到以下错误:

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.4:sonar (default-cli) on project app-dao: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.4:sonar failed: SonarQube server can not be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'. Connection refused -> [Help 1]
Run Code Online (Sandbox Code Playgroud)

我还尝试了maven 连接到 Sonar 中提到的解决方案,并在我的 maven 的 conf/settings.xml 文件中添加了以下条目,但仍然无法解决问题。

<profile>
  <id>sonar</id>
  <activation>
   <activeByDefault>true</activeByDefault>
  </activation>
  <properties>
    <!-- EXAMPLE FOR MYSQL -->          
    <sonar.jdbc.username>admin</sonar.jdbc.username>
    <sonar.jdbc.password>admin</sonar.jdbc.password>            
    <sonar.host.url>http://localhost:9000</sonar.host.url>
  </properties>
</profile>
Run Code Online (Sandbox Code Playgroud)

小智 0

今天早上刚刚遇到这个问题。通过配置服务器访问 MySQL 数据库解决了这个问题:http://docs.codehaus.org/display/SONAR/Installing

您想要编辑 {sonar_home}/conf/sonar.properties 并取消注释 url、用户名和密码。

如果您愿意,您可能必须添加新的数据库用户。