一、安装
[root@localhost bin]# rpm -qa | grep java
python-javapackages-3.4.1-11.el7.noarch
java-11-openjdk-headless-11.0.21.0.9-1.el7_9.x86_64
java-11-openjdk-11.0.21.0.9-1.el7_9.x86_64
tzdata-java-2023c-1.el7.noarch
javapackages-tools-3.4.1-11.el7.noarch
[root@localhost bin]#
[root@localhost bin]# yum remove java-11-openjdk-headless-11.0.21.0.9-1.el7_9.x86_64 java-11-openjdk-11.0.21.0.9-1.el7_9.x86_64
[root@localhost ~]# wget -c https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.rpm
[root@localhost ~]# rpm -ivh jdk-21_linux-x64_bin.rpm
warning: jdk-21_linux-x64_bin.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:jdk-21-2000:21.0.1-12 ################################# [100%]
[root@localhost ~]#
[root@localhost ~]# java --version
java 21.0.1 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)
[root@localhost ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo --no-check-certificate
--2023-12-25 18:57:37-- https://pkg.jenkins.io/redhat-stable/jenkins.repo
Resolving pkg.jenkins.io (pkg.jenkins.io)... 151.101.2.133, 151.101.66.133, 151.101.130.133, ...
Connecting to pkg.jenkins.io (pkg.jenkins.io)|151.101.2.133|:443... connected.
WARNING: cannot verify pkg.jenkins.io's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:
Issued certificate has expired.
HTTP request sent, awaiting response... 200 OK
Length: 85
Saving to: ‘/etc/yum.repos.d/jenkins.repo’
100%[=============================================================================================================================>] 85 --.-K/s in 0s
[root@localhost ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
[root@localhost ~]# yum install jenkins
[root@localhost ~]# systemctl start jenkins
#查看进程
[root@localhost ~]# 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 8731/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 8969/master
tcp6 0 0 :::8080 :::* LISTEN 92187/java
tcp6 0 0 :::22 :::* LISTEN 8731/sshd
tcp6 0 0 ::1:25 :::* LISTEN 8969/master
#查看文件
[root@localhost bin]# rpm -ql jenkins-2.426.2-1.1.noarch
/usr/bin/jenkins
/usr/lib/systemd/system/jenkins.service
/usr/share/java/jenkins.war
/usr/share/jenkins/migrate
/var/cache/jenkins
/var/lib/jenkins
二登录
http:ip(域名):8080
登录密码:
#查找登录密码登录,完成最后安装
[root@localhost bin]# cat /var/lib/jenkins/secrets/initialAdminPassword
安装完成后即可登录使用。