使用Sonarqube-4.5.1,http:// localhost:9000不能访问SonarQube服务器

我最近在我的Linux机器上安装了Sonarqube-4.5.1(x86_64 x86_64 x86_64 GNU / Linux)。
我可以用./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] 

我也尝试了maven连接到Sonar中提到的解决scheme,并在我的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> 

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

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

如果你愿意,你可能需要添加一个新的数据库用户。

您必须先启动Sonar服务器。

进入\sonar-3.5.1\bin\windows-x86-32并双击StartSonar.bat

在安装目录下的conf文件夹中,sonar.properties文件有一个属性sobar.web.host。 如果你明确地定义了一个IP,这可能会导致这个问题。 注释掉并重新启动服务器。 这对我有效。