分享 | 交流
让学习成为一种习惯

记一次Jenkins启动失败

[root@Jenkins ~]# systemctl start jenkins
Job for jenkins.service failed because the control process exited with error code. See “systemctl status jenkins.service” and “journalctl -xe” for details.
[root@Jenkins ~]# journalctl -xe
May 22 22:07:05 Jenkins jenkins.installer[1520]: No chown needed for /var/log/jenkins
May 22 22:07:05 Jenkins jenkins.installer[1521]: Checking /var/lib/jenkins ownership
May 22 22:07:05 Jenkins jenkins.installer[1522]: No chown needed for /var/lib/jenkins
May 22 22:07:05 Jenkins yum[1456]: Installed: jenkins-2.107.3-1.1.noarch
May 22 22:07:14 Jenkins polkitd[604]: Registered Authentication Agent for unix-process:1523:38078 (
May 22 22:07:14 Jenkins systemd[1]: Starting LSB: Jenkins Automation Server…
— Subject: Unit jenkins.service has begun start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit jenkins.service has begun starting up.
May 22 22:07:14 Jenkins runuser[1534]: pam_unix(runuser:session): session opened for user jenkins b
May 22 22:07:14 Jenkins jenkins[1529]: Starting Jenkins bash: /usr/bin/java: No such file or direct
May 22 22:07:14 Jenkins runuser[1534]: pam_unix(runuser:session): session closed for user jenkins
May 22 22:07:14 Jenkins jenkins[1529]: [FAILED]
May 22 22:07:14 Jenkins systemd[1]: jenkins.service: control process exited, code=exited status=1
May 22 22:07:14 Jenkins systemd[1]: Failed to start LSB: Jenkins Automation Server.
— Subject: Unit jenkins.service has failed
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

查找java路径

[root@Jenkins ~]# find / -name java
/etc/pki/ca-trust/extracted/java
/etc/pki/java
/etc/java
/usr/lib/java
/usr/share/java
/opt/jdk-10.0.1/bin/java

编辑Jenkins配置文件

[root@Jenkins ~]# vim /etc/init.d/jenkins

     66 candidates=”
     67 /etc/alternatives/java
     68 /usr/lib/jvm/java-1.8.0/bin/java
     69 /usr/lib/jvm/jre-1.8.0/bin/java
     70 /usr/lib/jvm/java-1.7.0/bin/java
     71 /usr/lib/jvm/jre-1.7.0/bin/java
     72 #/usr/bin/java
     73 /opt/jdk-10.0.1/bin/java
     74 “
将/usr/bin/java替换成/opt/jdk-10.0.1/bin/java,保存退出

重新启动服务

[root@Jenkins ~]# systemctl start jenkins
Warning: jenkins.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
[root@Jenkins ~]# systemctl status jenkins
● jenkins.service – LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
Active: active (exited) since Tue 2018-05-22 22:10:15 CST; 1min 8s ago
Docs: man:systemd-sysv-generator(8)
Process: 1602 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)

May 22 22:10:14 Jenkins systemd[1]: Starting LSB: Jenkins Automation Server…
May 22 22:10:14 Jenkins runuser[1607]: pam_unix(runuser:session): session opened for user jen…=0)
May 22 22:10:15 Jenkins jenkins[1602]: Starting Jenkins Jenkins requires Java 8, but you are …0.1
May 22 22:10:15 Jenkins jenkins[1602]: java.lang.UnsupportedClassVersionError: 54.0
May 22 22:10:15 Jenkins jenkins[1602]: at Main.main(Main.java:128)
May 22 22:10:15 Jenkins jenkins[1602]: [ OK ]
May 22 22:10:15 Jenkins systemd[1]: Started LSB: Jenkins Automation Server.
Warning: jenkins.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
Hint: Some lines were ellipsized, use -l to show in full.
[root@Jenkins ~]# systemctl daemon-reload
[root@Jenkins ~]# systemctl status jenkins
● jenkins.service – LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
Active: active (exited) since Tue 2018-05-22 22:10:15 CST; 1min 23s ago
Docs: man:systemd-sysv-generator(8)

May 22 22:10:14 Jenkins systemd[1]: Starting LSB: Jenkins Automation Server…
May 22 22:10:14 Jenkins runuser[1607]: pam_unix(runuser:session): session opened for user jen…=0)
May 22 22:10:15 Jenkins jenkins[1602]: Starting Jenkins Jenkins requires Java 8, but you are …0.1
May 22 22:10:15 Jenkins jenkins[1602]: java.lang.UnsupportedClassVersionError: 54.0
May 22 22:10:15 Jenkins jenkins[1602]: at Main.main(Main.java:128)
May 22 22:10:15 Jenkins jenkins[1602]: [ OK ]
May 22 22:10:15 Jenkins systemd[1]: Started LSB: Jenkins Automation Server.
Hint: Some lines were ellipsized, use -l to show in full.

未经允许不得转载:留时刻运维网 » 记一次Jenkins启动失败

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

留时刻 - Linux系统教程,运维经验分享

加入我们给我留言