詹金斯奴隶JNLP连接被终止

时间:2018-09-26 21:35:45

标签: docker jenkins haproxy jnlp rancher

在这里寻求帮助!

我将Jenkins(v2.134)作为由Rancher(v1.6.16)管理的Docker容器运行;我正在使用haproxy(HA-Proxy版本1.6.3 2015/12/25)作为我的负载均衡器。 Jenkins JNLP端口配置为50000。haproxy获得了TCP端口转发的规则(8081> 50000)

我的奴隶(macmini)在不同的网络中并且在防火墙后面(该网络可以访问我的Jenkins Infra)。我正在使用“通过隧道连接”属性和指定的端口“:8081”。端口8081已在防火墙中打开。

我的Jenkins Java版本是-

openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-1~deb9u1-b12)

我的从Java版本是-

Sun JDK "1.8.0_151"

以下是座席日志-

*INFO: Setting up agent: my-slave-01*
    Sep 26, 2018 2:48:50 PM hudson.remoting.jnlp.Main$CuiListener <init>
    INFO: Jenkins agent is running in headless mode.
    Sep 26, 2018 2:48:50 PM hudson.remoting.Engine startEngine
    INFO: Using Remoting version: 3.23
    Sep 26, 2018 2:48:50 PM hudson.remoting.Engine startEngine
    WARNING: No Working Directory. Using the legacy JAR Cache location: /Users/jenkins/.jenkins/cache/jars
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Locating server among [http://<My Jenkins URL>/]
    Sep 26, 2018 2:48:51 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
    INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    *INFO: Agent discovery successful*
     *Agent address: <My Jenkins DNS Name>*
     *Agent port:    8081*
     Identity:      b5:c7:33:8d:9c:97:41:3f:e1:b1:b5:31:25:ea:b5:2e
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Handshaking
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Connecting to <My Jenkins DNS>:8081
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Trying protocol: JNLP4-connect
    Sep 26, 2018 2:48:51 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Remote identity confirmed: b5:c7:33:8d:9c:97:41:3f:e1:b1:b5:31:25:ea:b5:2e
    Sep 26, 2018 2:48:52 PM hudson.remoting.jnlp.Main$CuiListener status
    *INFO: Connected*
    Sep 26, 2018 2:48:54 PM org.jenkinsci.remoting.util.AnonymousClassWarnings warn
    WARNING: Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.envinject.EnvInjectComputerListener$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
    Sep 26, 2018 2:49:49 PM hudson.remoting.jnlp.Main$CuiListener status
    *INFO: Terminated*

任何帮助将不胜感激。

有没有办法获取更多详细的日志?

1 个答案:

答案 0 :(得分:1)

我发现了问题;这是我的负载均衡器(haproxy)的TCP连接默认超时(如果没有流量)为50000ms。 https://cbonte.github.io/haproxy-dconv/configuration-1.5.html

然而,詹金斯到奴隶的ping间隔,即hudson.slaves.ChannelPinger.pingInterval为5分钟(错误)。 https://wiki.jenkins.io/display/JENKINS/Features+controlled+by+system+properties

增加负载均衡器超时,即> 5分钟即可解决此问题。