记录一次【Jenkins】启动失败:failed (Result: start-limit)

一、介绍 

本文指导解决Jenkins启动时遇到的systemd服务启动失败问题,包括检查JDK安装、配置路径、系统服务设置。

二、问题

安装完Jenkins后,尝试使用systemd服务启动失败,而且配置了jdk路径也无法解决。

错误信息如下:

● jenkins.service - Jenkins Continuous Integration Server
   Loaded: loaded (/usr/lib/systemd/system/jenkins.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since 五 2025-08-22 08:35:17 CST; 3s ago
  Process: 2801 ExecStart=/usr/bin/jenkins (code=exited, status=1/FAILURE)
 Main PID: 2801 (code=exited, status=1/FAILURE)

8月 22 08:35:17 localhost.localdomain systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
8月 22 08:35:17 localhost.localdomain systemd[1]: Failed to start Jenkins Continuous Integration Server.
8月 22 08:35:17 localhost.localdomain systemd[1]: Unit jenkins.service entered failed state.
8月 22 08:35:17 localhost.localdomain systemd[1]: jenkins.service failed.
8月 22 08:35:17 localhost.localdomain systemd[1]: jenkins.service holdoff time over, scheduling restart.
8月 22 08:35:17 localhost.localdomain systemd[1]: Stopped Jenkins Continuous Integration Server.
8月 22 08:35:17 localhost.localdomain systemd[1]: start request repeated too quickly for jenkins.service
8月 22 08:35:17 localhost.localdomain systemd[1]: Failed to start Jenkins Continuous Integration Server.
8月 22 08:35:17 localhost.localdomain systemd[1]: Unit jenkins.service entered failed state.
8月 22 08:35:17 localhost.localdomain systemd[1]: jenkins.service failed.

image

 三、排查解决

参照其他资料,以下的方法依然无法解决:

方法一:安装Java 8,检查配置文件配置/etc/init.d/jenkins文件中增加现有jdk的路径

yum install fontconfig java-8-openjdk

image

 方法二:创建软链接

ln -s /usr/local/java/jdk1.8.0_291/bin/java /usr/bin/java

方法三、检查端口占用

netstat -tuln | grep 8080

方法四、检查目录和文件权限

确保Jenkins运行用户(如jenkins)对/var/lib/jenkins等目录有读写权限,使用chownchmod调整权限

方法五、卸载了重新按照官方的步骤安装。(也不行!!!

四、找到问题

抱着尝试的态度使用手动启动。

cd /etc/init.d

# 启动
./jenkins start

启动出现报错:

image

才发现原来是Jenkins的版本问题,本文出现问题的版本:

1. Jenkins-2.346-1.1.noarch.rpm

2. Java 8

最后查看官方文档,Java8 支持的只有Jenkins-2.346-1.1及以下版本。

image

 

posted @ 2025-08-22 16:56  LuoTengteng  阅读(84)  评论(0)    收藏  举报