rpm解决Jenkins安装报错

安装Jenkins出现的问题
rpm安装
新建路径存放地址
mkdir /home/jenkins

下载地址
https://pkg.jenkins.io/redhat-stable/jenkins-2.204.5-1.1.noarch.rpm

Jenkins】# yum install -y jenkins-2.204.5-1.1.noarch.rpm
jenkins】# systemctl start jenkins.service

报错:
Mar 17 12:18:15 iZbp13os69edbi58q9yr87Z systemd[1]: Starting LSB: Jenkins Automation Server...
Mar 17 12:18:15 iZbp13os69edbi58q9yr87Z runuser[12627]: pam_unix(runuser:session): session opened for user root by (uid=0)
Mar 17 12:18:15 iZbp13os69edbi58q9yr87Z jenkins[12622]: Starting Jenkins bash: /usr/bin/java: No such file or directory
Mar 17 12:18:15 iZbp13os69edbi58q9yr87Z jenkins[12622]: [FAILED]
Mar 17 12:18:15 iZbp13os69edbi58q9yr87Z systemd[1]: jenkins.service: control process exited, code=exited status=1
Mar 17 12:18:15 iZbp13os69edbi58q9yr87Z systemd[1]: Failed to start LSB: Jenkins Automation Server.
Mar 17 12:18:15 iZbp13os69edbi58q9yr87Z systemd[1]: Unit jenkins.service entered failed state.
Mar 17 12:18:15 iZbp13os69edbi58q9yr87Z systemd[1]: jenkins.service failed.


原因是没有Java路径

jenkins】#which Java
/root/soft/jdk1.8.0_101/bin/java

jenkins】#vi /etc/rc.d/init.d/jenkins
找到 candidates ="/etc/...
/usr/.....
/usr/.......
/usr/.....
.........."
引号里面结果插入 /root/soft/jdk1.8.0_101/bin/java

Jenkins】#systemctl daemon-reload
jenkins】#service jenkins start
查看密码
jenkins】#cat /var/lib/jenkins/secrets/initialAdminPassword

posted @ 2020-03-17 13:00  快乐的平头哥  阅读(3028)  评论(0编辑  收藏  举报