jenkins启动报错解决方案

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jenkins启动报错解决方案相关的知识,希望对你有一定的参考价值。

参考技术A 启动jenkins报错: Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.

按提示输入systemctl status jenkins.service

看到原因是因为

最后想起来问题出在我重装了JDK, java地址变了

解决方法:
1> 查看当前Java的环境变量 echo $JAVA_HOME
2> 复制Java的环境变量地址, 编辑/etc/init.d/jenkins文件, 指定位置添加该地址, 后缀附上/bin/java vim /etc/init.d/jenkins

修改后重启jenkins服务, 问题解决 systemctl start jenkins

启动jenkins后无法访问,如何排错

文章都是前一天晚上抽出固定时间写,第二天定点8:00准时推送,记录每日所学,所想,持续输入输出,不断分享,提升自己。

linux服务器安装了jenkins,启动jenkins后无法访问,无法访问截图如下:

上面图片可以看到网络是没问题的

第二步:通过cat 命令查看日志发现日志中没有ip访问的信息,忘记截图了这一步没有截图。

第三步:网上搜索答案解决了我的问题,以下是别人文章解决方案:

1. 看日志是否有报错 ?

命令:tail -100f nohup.out
 
   
   
 
[root@istester ~]# tail -100f nohup.out
2020-06-08 03 :18 :52.337+0000 [id=15] WARNING hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb d432de6031e06511f6e8bdb01486a11636b9dfe5bda2411a9d80c5c49c9d586f. If you are calling this URL with a script, please use the API Token instead. More information: https: //jenkins.io/redirect/crumb-cannot-be-used-for-script
2020-06-08 03 :18 :52.337+0000 [id=15] WARNING hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for / job/ idoxu_v1.0-bossxu/ descriptorByName/ hudson.plugins.git.UserRemoteConfig/ fillCredentialsIdItems by wyftest. Returning 403.
注:nohup.out是Jenkins启动的日志文件,在你当前启动的目录;如果是其他应用,或者你们自己的生产服务器,可以问问开发同学,日志会放在哪个目录,一般是 /APP/log/xx/xxx.log

2. 看进程是否在 ?

命令:ps -ef|grep jenkins
 
   
   
 
[ root@istester ~] # ps -ef|grep jenkins
root 16354 1 0 Jun03 ? 00 :11:53 java -jar /APP/idoxu/software/jenkins
注:jenkins 是过滤当前的进程关键词 。

3. 看端口被占用 ?

命令:netstat -nltp
 
   
   
 
[ root@istester ~] # netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0 :22 0.0.0.0 :* LISTEN 30736 /sshd
tcp6 0 0 :::3306 :::* LISTEN 24987 /mysqld
tcp6 0 0 :::80 :::* LISTEN 16354 /java
tcp6 0 0 :::3000 :::* LISTEN 9416 /./gogs
注:如果看到你的端口在,说明正常 。

4. 看防火墙是否关闭 ?

  • 1)Centos 7.x
    关闭防火墙 systemctl stop firewalld.service
 
   
   
 
[root@istester ~]# systemctl stop firewalld.service
[root@istester ~]# systemctl status firewalld.service
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man :firewalld(1)
[root@istester ~]# systemctl start firewalld.service
[root@istester ~]# systemctl status firewalld.service
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2020-04-14 23 :56 :26 CST; 1s ago
Docs: man :firewalld(1)
Main PID: 12615 (firewalld)
CGroup: / system.slice/ firewalld.service
├─ 12615 / usr/ bin/ python -Es / usr/ sbin/ firewalld --nofork --nopid
└─ 12812 / usr/ bin/ python -Es / usr/ sbin/ firewalld --nofork --nopid

Apr 14 23 :56 :25 istester systemd [1]: Starting firewalld - dynamic firewall daemon...
Apr 14 23 :56 :26 istester systemd [1]: Started firewalld - dynamic firewall daemon.
[root@istester ~]#
  • 2)Centos 6.x
    关闭防火墙 service iptables stop
 
   
   
 
[root@iZ94b31ttqsZ]~ # service iptables status
iptables: Firewall is not running.

如上解决了我的问题,记录下方便后续查看,如果文章对你有帮助,可以关注我,已坚持日更19/365