启动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