将slave(windows)连接到master(linux)时的连接超时

时间:2018-02-22 12:15:59

标签: jenkins

我正在努力将我的Windows奴隶连接到Jenkins服务器(Linux),但没有运气。尝试了很多方法,很少解决,最后,我陷入了连接超时。我看到一些提到类似问题的帖子没有回应。

例外记录

C:\jenkinsbin>java -jar slave.jar -jnlpUrl https://<jenkins.com>/comput
er/SFDC%20Node/slave-agent.jnlp -secret <****> -workDir "C:/jenkinsslavesfdc"
Feb 22, 2018 2:16:40 AM org.jenkinsci.remoting.engine.WorkDirManager initializeW
orkDir
INFO: Using C:\jenkinsslavesfdc\remoting as a remoting work directory
Both error and output logs will be printed to C:\jenkinsslavesfdc\remoting
Feb 22, 2018 2:16:41 AM hudson.remoting.jnlp.Main createEngine
INFO: Setting up slave: SFDC Node
Feb 22, 2018 2:16:41 AM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Feb 22, 2018 2:16:41 AM org.jenkinsci.remoting.engine.WorkDirManager initializeW
orkDir
INFO: Using C:\jenkinsslavesfdc\remoting as a remoting work directory
Feb 22, 2018 2:16:41 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://<jenkins.com>/]
Feb 22, 2018 2:16:43 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver
resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, JNLP-conn
ect, Ping, JNLP2-connect]
Feb 22, 2018 2:16:43 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Agent discovery successful
  Agent address: <jenkins.com>
  Agent port:    55202
  Identity:      80:e0:51:b6:65:64:7b:78:ce:ea:7d:c2:9d:27:5b:2a
Feb 22, 2018 2:16:43 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Feb 22, 2018 2:16:43 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to jenkins.com:55202
Feb 22, 2018 2:17:14 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to jenkins.com:55202 (retrying:2)
java.io.IOException: Failed to connect to jenkins.com:55202
        at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoin
t.java:243)
        at hudson.remoting.Engine.connect(Engine.java:667)
        at hudson.remoting.Engine.innerRun(Engine.java:528)
        at hudson.remoting.Engine.run(Engine.java:451)
Caused by: java.net.ConnectException: Connection timed out: connect
        at sun.nio.ch.Net.connect0(Native Method)
        at sun.nio.ch.Net.connect(Unknown Source)
        at sun.nio.ch.Net.connect(Unknown Source)
        at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
        at java.nio.channels.SocketChannel.open(Unknown Source)
        at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoin
t.java:204)
        ... 3 more

很少有观察来自我的结局:

  1. Slave能够ping jenkins.com
  2. 在防火墙(入站和出站)规则下添加了端口55202以允许从站连接。
  3. 端口55202正在监听主人
  4. 另外,既然我使用windows作为我的奴隶,是否建议只使用java web start?
  5. 在奴隶中尝试过traceroute,但非常不一致。
  6. master中的iptables是否受限于任何不同的子网?我猜主人没有响应,因此连接超时?

1 个答案:

答案 0 :(得分:0)

罗希特夏尔,

您能否检查一下这是否与您的情况相关? Connecting Jenkins slave agent on windows failed with connection timeout

W.r.t。 2:如果您在同一个安全网络中工作,则可以完全关闭防火墙。