- A+
所属分类:jenkins
问题1:启动报错记录,报错如下:
- [root@urcar3 ~]# systemctl start jenkins
- Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
- [root@urcar3 ~]# systemctl status jenkins.service
- ● jenkins.service - LSB: Jenkins Automation Server
- Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
- Active: failed (Result: exit-code) since Mon 2018-07-02 17:58:51 CST; 11s ago
- Docs: man:systemd-sysv-generator(8)
- Process: 124137 ExecStop=/etc/rc.d/init.d/jenkins stop (code=exited, status=0/SUCCESS)
- Process: 124164 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)
- Jul 02 17:58:51 urcar3 systemd[1]: Starting LSB: Jenkins Automation Server...
- Jul 02 17:58:51 urcar3 runuser[124169]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
- Jul 02 17:58:51 urcar3 jenkins[124164]: Starting Jenkins bash: /usr/bin/java: No such file or directory
- Jul 02 17:58:51 urcar3 runuser[124169]: pam_unix(runuser:session): session closed for user jenkins
- Jul 02 17:58:51 urcar3 jenkins[124164]: [FAILED]
- Jul 02 17:58:51 urcar3 systemd[1]: jenkins.service: control process exited, code=exited status=1
- Jul 02 17:58:51 urcar3 systemd[1]: Failed to start LSB: Jenkins Automation Server.
- Jul 02 17:58:51 urcar3 systemd[1]: Unit jenkins.service entered failed state.
- Jul 02 17:58:51 urcar3 systemd[1]: jenkins.service failed.
报错原因:启动脚本里面的java版本路径与服务器java环境不匹配
问题解决:
- [root@urcar3 ~]# cat /etc/init.d/jenkins
- ......
- ......
- candidates="
- /etc/alternatives/java
- /usr/lib/jvm/java-1.8.0/bin/java
- /usr/lib/jvm/jre-1.8.0/bin/java
- /usr/lib/jvm/java-1.7.0/bin/java
- /usr/lib/jvm/jre-1.7.0/bin/java
- /usr/bin/java #修改为本服务器的java命令路径或者建立一个软连接即可
- "
- ......
- ......
问题2:jenkins Web界面安装插件报 jenkins实例似乎已离线。问题界面如下:
报错原因:jenkins默认连接的网络浏览器是谷歌的,服务器没配置代理,所以导致jenkins离线。
问题解决:将 /var/lib/jenkins/updates/default.json 文件(安装方式不同,该文件的位置路径可有也会不同,可以使用 find 查找一下)中的 www.google.com 换成我们国内的浏览器百度(www.baidu.com )即可。换了之后重启 jenkins,但是还有个别的插件没办法下载,必须翻墙下载。