Windows

詹金斯奴隸在Windows上握手失敗

  • January 16, 2018

我有一台 win2k8 機器用作我們的 CI 主伺服器 (Jenkins)

我有各種其他伺服器作為從伺服器執行

master 正在監聽 2000 埠上的 slave 連接

  • SlaveA -可以連接到 2000 上的主機
  • SlaveB -無法連接到 2000 上的主機
  • SlaveB - 可以連接到另一個埠上的主控
  • 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)

但是,我不知道為什麼要重置連接,也不知道去哪裡看:(

當我自己嘗試連接 w2k8 jenkins slave 時,我自己也遇到了那個確切的錯誤。

我已經編譯了這個最終導致 Jenkins slave 成功連接到 master 的列表:

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.

我希望這有幫助。

引用自:https://serverfault.com/questions/317996