未能启动詹金斯奴隶

时间:2017-07-03 10:20:57

标签: jenkins jenkins-slave

我正在尝试在我们的服务器上设置jenkins群集。配置从属节点后,尝试从主节点启动该从属节点后,无法启动。

错误日志

[07/03/17 11:12:19] [SSH] Checking java version of java
[07/03/17 11:12:19] [SSH] java -version returned 1.5.0.
[07/03/17 11:12:19] [SSH] Starting sftp client.
[07/03/17 11:12:19] [SSH] Copying latest slave.jar...
[07/03/17 11:12:19] [SSH] Copied 717,563 bytes.
Expanded the channel window size to 4MB
[07/03/17 11:12:19] [SSH] Starting slave process: cd "/app/taiji/build/jenkins2" && java  -jar slave.jar
Exception in thread "main" java.lang.ClassFormatError: hudson.remoting.Launcher (unrecognized class file version)
   at java.lang.VMClassLoader.defineClass(libgcj.so.10)
   at java.lang.ClassLoader.defineClass(libgcj.so.10)
   at java.security.SecureClassLoader.defineClass(libgcj.so.10)
   at java.net.URLClassLoader.findClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at gnu.java.lang.MainThread.run(libgcj.so.10)
Slave JVM has terminated. Exit code=1
[07/03/17 11:12:19] Launch failed - cleaning up connection
[07/03/17 11:12:19] [SSH] Connection closed.

我注意到的一件事是它似乎存在java版本不匹配的问题。

似乎返回java版本1.5。但我检查了奴隶和主服务器。它目前安装了Java 1.8。

ldndsr000004921$ java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

jenkins系统环境如下:

enter image description here

请指教?

1 个答案:

答案 0 :(得分:0)

这是由于javPath设置不正确。我能够通过指定javaPath来修正它来修正它。

enter image description here

设置完成后,jenkins代理能够成功启动,如下所示

[07/04/17 03:18:56] [SSH] Starting sftp client.
[07/04/17 03:18:56] [SSH] Copying latest slave.jar...
[07/04/17 03:18:56] [SSH] Copied 717,563 bytes.
Expanded the channel window size to 4MB
[07/04/17 03:18:56] [SSH] Starting slave process: cd "/app/taiji/build/jenkins2" && /app/phoenix/jdk1.8.0_66/bin/java  -jar slave.jar
<===[JENKINS REMOTING CAPACITY]===>channel started
Slave.jar version: 3.4.1
This is a Unix agent
Evacuated stdout
Agent successfully connected and online