【日常记录】Jenkins安装时错误

安装方法

1、下载war包安装(推荐)
2、使用rmp安装
安装完后路径:
/usr/lib/jenkins/jenkins.war    WAR包 
/etc/sysconfig/jenkins       配置文件,“端口”,“JENKINS_HOME”等都可以在这里配置。
/var/lib/jenkins/       默认的JENKINS_HOME目录
/var/log/jenkins/jenkins.log    Jenkins日志文件

安装完后启动服务

service jenkins start|stop|restart

启动时报错
错误1:

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.

解决办法:vi /etc/sysconfig/jenkins 修改JENKINS_USER="jenkins" 修改为JENKINS_USER="root"
或者将jenkins加入到root权限

错误2:

Starting jenkins (via systemctl):  Warning: jenkins.service changed on disk. Run 'systemctl daemon-reload' to reload units.

Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
解决办法:vi /etc/rc.d/init.d/jenkins 增加java路径(路径查看:which java)
```shell
 sudo usermod -a -G root jenkins

错误3:自动安装完成之后: 
通过浏览器打开Jenkins安装插件时,报错:无法连接到Jenkins服务器

Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:

Permission you need to have (but didn't): hudson.model.Hudson.Administer
-->

解决办法:
将Jenkins用户添加到根组: sudo usermod -a -G root jenkins
制作Jenkins通过编辑文件 / etc / sysconfig / jenkins 并更改 JENKINS_LISTEN_ADDRESS =0.0.0.0

posted @ 2020-06-10 14:38  link_ed  阅读(1473)  评论(0编辑  收藏  举报