啟動Jenkins報錯"Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details."解決辦法


一、 下載Jenkins 

[root@Jessiestart software]# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo

 

[root@Jessiestart software]# sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

 

[root@Jessiestart software]# yum install jenkins

 

 二、 修改配置文件

1. 修改端口和權限

[root@Jessiestart software]# vim /etc/sysconfig/jenkins

#修改監聽端口
JENKINS_PORT="8081"

#修改權限為root
JENKINS_USER="root"

2. 修改目錄權限

[root@Jessiestart software]# chown -R root:root /var/lib/jenkins
[root@Jessiestart software]# chown -R root:root /var/cache/jenkins
[root@Jessiestart software]# chown -R root:root /var/log/jenkins

 

 三、 啟動Jenkins和排查啟動失敗

1. 啟動,但失敗

[root@Jessiestart software]# systemctl start jenkins

噢嚯兒,啟動失敗。

報錯了,錯誤信息為:

[root@Jessiestart software]# service jenkins restart
Restarting jenkins (via systemctl):  Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.

 2. 排查問題

    用systemctl status jenkins.service來檢查下下狀態

[root@Jessiestart software]# systemctl status jenkins.service

根據提示的信息,是JDK的路徑配置不對

3. 修改Jenkins配置文件

現在修改Jenkins啟動腳本的JDK路徑:

[root@Jessiestart software]# vim /etc/rc.d/init.d/jenkins

最后一排,默認路徑是:/usr/bin/java

需要改成自己的JDK路徑,我的是:/usr/local/jdk/bin/java,注意要寫到java文件

 

 四、 重新啟動Jenkins驗證

1. 重新啟動Jenkins並查看狀態

再次查看狀態,是active了

[root@Jessiestart software]# systemctl start jenkins
Warning: jenkins.service changed on disk. Run 'systemctl daemon-reload' to reload units.
[root@Jessiestart software]# systemctl daemon-reload

再查看下進程

[root@Jessiestart software]# ps -ef | grep jenkins

2. 瀏覽器訪問驗證

http://xxx.xx.xxx.xxx:8081/

啟動成功!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 Jenkins報錯:Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details. Jenkins 安裝啟動提示“iJob for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.” Job for jenkins.service failed because the control process exited with error code. See "systemctl st Jenkins++:Job for jenkins.service failed because the control process exited with error code. See "systemctl st linux----------啟動network的時候報錯Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. centos7啟動MySQL報 Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. docker 啟動失敗 Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. 啟動Nginx服務失敗:Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. docker 報錯: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -xe" for details.
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM