jenkins-cli命令返回连接超时 [英] jenkins-cli commands returning connect timed out

查看:142
本文介绍了jenkins-cli命令返回连接超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对此jenkins-cli错误有任何建议/修复?

Any suggestions/fixes for this jenkins-cli error?

我有一个部署作业,该作业已参数化(测试,阶段,生产).因此,每当有部署到登台"环境时,我都试图让Jenkins 执行一个时髦的脚本.尝试测试jenkins-cli.jar时,出现此错误:

I have a deploy job, which is parameterized (test, stage, prod). So, whenever there is a deploy to the "staging" environment, i am trying to make Jenkins slaves execute a groovy script. Trying to test the jenkins-cli.jar, i got this error:

[jenkins@ip-10-0-0-92 scripts]$ java -jar jenkins-cli.jar -s https://my_jenkins_URL/ help
Exception in thread "main" java.net.SocketTimeoutException: connect timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at hudson.cli.CLI.connectViaCliPort(CLI.java:203)
    at hudson.cli.CLI.<init>(CLI.java:126)
    at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
    at hudson.cli.CLI._main(CLI.java:466)
    at hudson.cli.CLI.main(CLI.java:382)
    Suppressed: java.io.EOFException: unexpected stream termination
        at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:331)
        at hudson.remoting.Channel.<init>(Channel.java:421)
        at hudson.remoting.Channel.<init>(Channel.java:400)
        at hudson.remoting.Channel.<init>(Channel.java:396)
        at hudson.remoting.Channel.<init>(Channel.java:385)
        at hudson.remoting.Channel.<init>(Channel.java:377)
        at hudson.remoting.Channel.<init>(Channel.java:353)
        at hudson.cli.CLI.connectViaHttp(CLI.java:157)
        at hudson.cli.CLI.<init>(CLI.java:130)
        ... 3 more

我已经完成:

  1. 为CLI和从属服务器的TCP/IP端口设置一个固定端口.在主服务器上监听
  2. 所有端口在jenkins节点之间都是开放的
  3. 通过 https://wiki.jenkins-ci.org/display /JENKINS/Jenkins + CLI

我正在使用具有有效SSL证书的Nginx.

I am using nginx with valid SSL cert.

PS:我遇到了以下两个问题.它们很接近,但是没有一个解决方案,而问题以其自己的方式是独特的.

PS: i came accross the below 2 questions. they are close but none have a solution and the issues are unique in its own ways.

如何拥有jenkins-cli. Jenkins运行JAR来执行jar工作吗? 带有HTTPS的詹金斯CLI

推荐答案

我遇到了相同的错误,并通过在/etc/hosts文件中添加新条目来修复了该错误.

I got the same error and fixed it by adding a new entry in /etc/hosts file.

我添加的行是:

10.0.0.11 jenkins.xxxxx.com

问题在于,从服务器无法解析Jenkins主服务器.自从我为Jenkins主服务器设置新服务器以来,这种情况一直在发生.

The issue is that the slave couldn't resolve the Jenkins master. This has been happening since I set up a new server for my Jenkins master.

这篇关于jenkins-cli命令返回连接超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆