Jenkins无法联系到本地主机

Jenkins无法联系到本地主机,jenkins,sonarqube,Jenkins,Sonarqube,我的Jenkins和Sonarqube localhost之间存在连接问题,在构建过程中,我的Jenkins管道作业失败,出现以下错误 注意:我启用了防火墙规则9000,但仍然失败 03:10:33.722 DEBUG: Download: http://sonarqube:9000/batch/index 03:10:33.780 ERROR: SonarQube server [http://sonarqube:9000] can not be reached 03:10:33.780 IN

我的Jenkins和Sonarqube localhost之间存在连接问题,在构建过程中,我的Jenkins管道作业失败,出现以下错误

注意:我启用了防火墙规则9000,但仍然失败

03:10:33.722 DEBUG: Download: http://sonarqube:9000/batch/index
03:10:33.780 ERROR: SonarQube server [http://sonarqube:9000] can not be reached
03:10:33.780 INFO: ————————————————————————
03:10:33.780 INFO: EXECUTION FAILURE
03:10:33.781 INFO: ————————————————————————
03:10:33.781 INFO: Total time: 0.587s
03:10:33.799 INFO: Final Memory: 3M/121M
03:10:33.799 INFO: ————————————————————————
03:10:33.800 ERROR: Error during SonarQube Scanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
我的本地主机Sonarqube已在我的机器中启动并运行,而且我可以浏览它


你能找个人帮我解决这个问题吗?

你的Jenkins主持人的目标似乎是
http://sonarqube:9000
但是您的curl命令是针对
http://localhost:9000/
。这种差异是故意的吗?嗨,Mc1arke,我解决了这个问题,我在jenkins管道脚本中正确配置了主机名,我已经像这样更新了jenkins脚本,然后它开始工作了。
--2019-12-30 10:33:26--  http://localhost:9000/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:9000... connected.
HTTP request sent, awaiting response... 200 
Length: unspecified [text/html]
Saving to: ‘index.html.3’

index.html.3                              [ <=>                                                                   ]  34.74K  --.-KB/s    in 0s      

2019-12-30 10:33:26 (231 MB/s) - ‘index.html.3’ saved [35575]

1) Manage Jenkins –> Global Tool Configuration –> SonarQube Scanner configured, please find the attached image.sonar-scanner Jenkins configuration

2) Configure SonarQube server in Jenkins, this will communicate SonarQube Server authentication.

Log in into your SonarQube Server and find following under user bar Go to My Account –> Security –> Generate Token

Sonar-server token jenkins authentication