Jenkins SSH代理配置

pb3s4cty  于 2023-11-17  发布在  Jenkins
关注(0)|答案(2)|浏览(143)

我正在尝试为我的Jenkins控制器配置代理。我执行了以下步骤。
1.启用远程主机的无密码身份验证(GNU Linux)
1.已在控制器上配置代理
我可以看到slave.jar正在复制到远程主机文件夹。但它失败了,并出现以下错误

Expanded the channel window size to 4MB
  [11/07/14 19:11:54] [SSH] Starting slave process: cd "/test/app/abc/slavetest" && /usr/java        /jdk1.6.0_29 -XX:MaxPermSize=2048m -Xmx2048m -jar slave.jar
  bash: /usr/java/jdk1.6.0_29: is a directory
  hudson.util.IOException2: Slave JVM has terminated. Exit code=126
    at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:953)
    at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:133)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:711)
    at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
  Caused by: java.io.EOFException: unexpected stream termination
    at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:200)
    at hudson.remoting.Channel.<init>(Channel.java:419)
    at hudson.remoting.Channel.<init>(Channel.java:398)
    at hudson.remoting.Channel.<init>(Channel.java:394)
    at hudson.remoting.Channel.<init>(Channel.java:383)
    at hudson.remoting.Channel.<init>(Channel.java:375)
    at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:344)
    at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:945)
    ... 7 more  
  [11/07/14 19:11:54] Launch failed - cleaning up connection
  [11/07/14 19:11:54] [SSH] Connection closed.

字符串
知道我哪里做错了吗

rggaifut

rggaifut1#

你的slave到java可执行文件的路径配置错误:

/usr/java        /jdk1.6.0_29 -XX:MaxPermSize=2048m -Xmx2048m -jar slave.jar

字符串
应删除空格,并将完整路径

/usr/java/jdk1.6.0_29/bin/java

gr8qqesn

gr8qqesn2#

我也是刚刚遇到的,最好通过登录容器并运行whereis java来检查docker容器/slave的java路径。
主机和代理的java路径可能不一样。并且jar和java命令是从代理内部执行的。

相关问题