centos系列,yum部署jenkins2.479.1,2024年长期支持版本
0、介绍
注意:jenkins建议安装LTS长期支持版本,而不是安装每周更新版本,jenkins安装指定版本
openjdk官网下载
Index of /jenkins/redhat-stable/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
Jenkins 宣布:从 6 月 28 日发布的 Jenkins 2.357 ,Jenkins 最低需要 Java 11。
Jenkins 2.357及以后的版本要求jdk版本最低11,否则启动时会报错
Jenkins 2.357以前的版本可以使用jdk8
Long Term Support (LTS) Release Line
Supported Java versions for the LTS release line are:
-
2.479.1 (October 2024) and newer
Java 17 or Java 21
-
2.426.1 (November 2023) and newer
Java 11, Java 17 or Java 21
-
2.361.1 (September 2022) and newer
Java 11 or Java 17
-
2.346.1 (June 2022) and newer
Java 8, Java 11, or Java 17
-
2.164.1 (March 2019) and newer
Java 8 or Java 11
-
2.60.1 (June 2017) and newer
Java 8
-
1.625.1 (October 2015) and newer
Java 7
1、openjdk 17配置
//获取文件后,解压移动
[root@node33-104 tmp]# ls OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz
OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz
[root@node33-104 tmp]# tar xf OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz
[root@node33-104 tmp]#mv jdk-17.0.12+7/ /usr/local/
[root@node33-104 tmp]# ls /usr/local/jdk-17.0.12+7/
bin conf include jmods legal lib man NOTICE release
//环境变量配置
vi /etc/profile
export JAVA_HOME=/usr/local/jdk-17.0.12+7
export JRE_HOME= J A V A H O M E / j r e e x p o r t C L A S S P A T H = . : JAVA_HOME/jre export CLASSPATH=.: JAVAHOME/jreexportCLASSPATH=.:{JAVA_HOME}/lib: J R E H O M E / l i b e x p o r t P A T H = {JRE_HOME}/lib export PATH= JREHOME/libexportPATH=JAVA_HOME/bin: J R E H O M E / b i n : JRE_HOME/bin: JREHOME/bin:PATH
source /etc/profile
2、openjdk 17 安装完成
[root@node33-104 tmp]# java -version
openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment Temurin-17.0.12+7 (build 17.0.12+7)
OpenJDK 64-Bit Server VM Temurin-17.0.12+7 (build 17.0.12+7, mixed mode, sharing)
[root@node33-104 tmp]#
3、jenkins 2.479.1 rpm安装完成
//获取文件后,安装
[root@node33-104 tmp]# ls jenkins-2.479-1.1.noarch.rpm
jenkins-2.479-1.1.noarch.rpm
[root@node33-104 tmp]# yum install -y /tmp/jenkins-2.479-1.1.noarch.rpm
4、jenkins配置
vi /usr/lib/systemd/system/jenkins.service
修改为一下
1
User=root
Group=root
2
Environment="JAVA_HOME=/usr/local/jdk-17.0.12+7/"
3
Environment="JENKINS_JAVA_CMD=/usr/local/jdk-17.0.12+7/bin/java"
4//8080访问端口是默认高危常见端口,可以自定义
Environment="JENKINS_PORT=8080"
5、启动jenkins,并开机自启
[root@node33-104 tmp]# systemctl start jenkins
[root@node33-104 tmp]# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
Loaded: loaded (/usr/lib/systemd/system/jenkins.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2024-10-09 17:19:51 CST; 2 days ago
[root@node33-104 tmp]# ss -atnl
LISTEN 0 50 [::]:8080 [::]😗
[root@node33-104 tmp]# systemctl enable jenkins
6、访问jenkins
ip+8080
亲测有效
既可以安装,需要的插件了,开始了
小编有话要说,觉得要用的话,麻烦点赞或收藏,有什么问题可以评论留言大家一起讨论