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

    启动成功!

  • 相关阅读:
    NTP on FreeBSD 12.1
    Set proxy server on FreeBSD 12.1
    win32 disk imager使用后u盘容量恢复
    How to install Google Chrome Browser on Kali Linux
    Set NTP Service and timezone on Kali Linux
    Set static IP address and DNS on FreeBSD
    github博客标题显示不了可能是标题包含 特殊符号比如 : (冒号)
    server certificate verification failed. CAfile: none CRLfile: none
    删除文件和目录(彻底的)
    如何在Curl中使用Socks5代理
  • 原文地址:https://www.cnblogs.com/littlemonsterksn/p/15839688.html
Copyright © 2020-2023  润新知