Jenkins 从站无法在 Windows 上握手

Jenkins 从站无法在 Windows 上握手

我有一台 win2k8 机器用作我们的 CI 主服务器(Jenkins)

我有其他多个作为从属运行的服务器

主服务器正在监听 2000 端口上的从服务器连接

  • 奴隶A-连接到 2000 上的 master
  • SlaveB-是无法连接到 2000 上的 master
  • SlaveB - 可以连接到 master其他港口
  • SlaveA-只有 2000 个可用端口
  • SlaveB - 似乎没有使用端口 2000 做任何事情,并且没有任何防火墙规则阻止它的使用,如 netstat 所示

SlaveA 和 SlaveB 的行为在几台不同的机器中很常见。例如,我有 3 台不相关的服务器(不同的主机,不同的网络),它们不连接,还有几台可以连接。

连接失败时从属代理的输出为:

03-Oct-2011 15:07:22 hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Hudson agent is running in headless mode.
03-Oct-2011 15:07:22 hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http://myserver:8080/]
03-Oct-2011 15:07:22 hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to myserver:2000
03-Oct-2011 15:07:22 hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
03-Oct-2011 15:08:23 hudson.remoting.jnlp.Main$CuiListener error
SEVERE: Connection reset
java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at hudson.remoting.Engine.readLine(Engine.java:279)
        at hudson.remoting.Engine.run(Engine.java:211)

由于telnet可以工作,网络人员声称自己是无辜的

由于该应用程序在不同的端口上运行,我无法从软件方面获得太多输入

我不知道下一步该尝试什么来帮助调试这种情况:(

非常感谢您的任何建议。

更新:看来正在建立从属和主控之间的连接,如在主日志上我得到以下输出:

INFO: Accepted connection #13 from /MY.SLAVE.IP.ADDRESS:58545
Oct 3, 2011 5:38:09 PM hudson.TcpSlaveAgentListener$ConnectionHandler run
WARNING: Connection #13 failed
java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.io.DataInputStream.readUnsignedShort(Unknown Source)
    at java.io.DataInputStream.readUTF(Unknown Source)
    at java.io.DataInputStream.readUTF(Unknown Source)
    at hudson.TcpSlaveAgentListener$ConnectionHandler.run(TcpSlaveAgentListener.java:178)

但是,我不知道为什么连接被重置,也不知道去哪里查找:(

答案1

当我自己尝试连接 w2k8 jenkins 从属服务器时,我自己也遇到了同样的错误。

我整理了以下列表,列出了最终导致 Jenkins 从服务器成功连接到主服务器的因素:

1. Make sure that Java 1.8 is installed on the server.
2. Download Jenkins from:
https://jenkins.io/content/thank-you-downloading-windows-installer/#stable
and install it.
3. Make sure that the user windows user is a member of the local administrative account on the server.
4. Once Jenkins is installed, open services, find Jenkins service, right click and properties, click the “Log on” tab and make sure that “This account” is set with the windows user you chose, save and restart the service.
5. Open “Local security Policy” on the server, on the left panel, under “Security settins” -> “Local Policies” -> “User rights assignments” -> find policy: “Log on as a batch job”, open it and make sure that the local administrative group is added there.
6. Repeat the same steps for the policy “Log on as a service”.
7. Open “regedit”, find the following keys and repeat the steps on both of them:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{72C24DD5-D70A-438B-8A42-98424B88AFB8}
HKEY_CLASSES_ROOT\CLSID\{76A64158-CB41-11D1-8B02-00600806D9B6}
a. Right click the key and choose permissions.
b. Click “Advanced”.
c. In the line of “Owner”, click “change”.
d. Click “Locations” and choose the first line (this computer).
Then, in the lower box write “Administrators” and click “Check Names”, then click ok and apply.
e. Double click the Administrators line and choose under Basic permissions “Full Control” and click ok and apply.
f. In the line of “Owner”, click “change”.
g. Click “Locations” and choose the first line (this computer).
Then, in the lower box write “NT Service\trusted” and click “Check Names”, then click ok and apply.
8. Restart the server.
9. When the server is back up, open the browser and browse to:
http://JENKINS_IP:8080 and log in.
10. Then on the left panel click Jenkins -> Manage server -> Manage nodes.
11. On the left panel, click “New Node”, name it and choose “Permanent agent”.
Then in the node settings:
12. Set # of executors.
13. Set Remote root directory c:\jenkins.
14. Set: 
a. a label as the name of server.
b. Launch method: choose “Let Jenkins controlthis Windows slave as a windows service”.
c. Use javab as the “Administrator” (set user and password).
d. Run service as: choose “Use administrator account given above”.
e. Click save.
15. Once the node appears in the list of nodes, click it and choose connect node and allow 3 minutes to make the connection, even if you get an error, ignore it and it will eventually connect to the node.
At this point the new node is ready to accept jobs.

我希望这有帮助。

相关内容