jenkins安装部署

环境:
Os:Centos 7
jenkins:jenkins-2.346-1.1

1.查看当前java版本
[root@host134 soft]# java -version
java version "1.8.0_361"
Java(TM) SE Runtime Environment (build 1.8.0_361-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.361-b09, mixed mode)

 

2.下载jenkins
wget https://mirrors.jenkins-ci.org/redhat/jenkins-2.346-1.1.noarch.rpm

 

3.离线安装
rpm -ivh jenkins-2.346-1.1.noarch.rpm

 

4.开机自启动
[root@host134 soft]# systemctl enable jenkins
Created symlink from /etc/systemd/system/multi-user.target.wants/jenkins.service to /usr/lib/systemd/system/jenkins.service.
[root@host134 soft]# systemctl start jenkins


5.浏览器打开
http://192.168.1.134:8080

 

 

安装比较新版本的jenkins,比如jenkins-2.477-1.1.noarch,需要java17以上的版本

 

 

1.下载java 17
https://www.oracle.com/java/technologies/downloads/#java17
我这里下载的是:jdk-17_linux-x64_bin.rpm

 

 

2.安装
[root@master1 soft]#rpm -ivh jdk-17_linux-x64_bin.rpm

 

 

3.选择刚才安装的java版本
[root@master1 soft]# alternatives --config java

 

There are 4 programs which provide 'java'.

 

Selection Command
-----------------------------------------------
1 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.261-2.6.22.2.el7_8.x86_64/jre/bin/java)
2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64/jre/bin/java)
+ 3 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.23.0.9-2.el7_9.x86_64/bin/java)
* 4 /usr/lib/jvm/jdk-17.0.12-oracle-x64/bin/java

 

Enter to keep the current selection[+], or type selection number: 4

 

我这里选择第4个

 

 

4.启动jenkins
[root@master1 ~]# systemctl start jenkins

 

posted @ 2024-09-20 09:51  slnngk  阅读(12)  评论(0编辑  收藏  举报