部署java环境
jdk下载
https://www.oracle.com/java/technologies/javase-jdk16-downloads.html
后面启动jenkins发现只支持[8-11]的jdk版本
安装
rpm -ivh jdk-16_linux-x64_bin.rpm
环境变量配置
vim /etc/profile
# 添加环境变量
export JAVA_HOME=/usr/java/jdk-16
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JRE_HOME=$JAVA_HOME/jre
rpm安装的jdk的卸载
#先查询有哪些jdk
rpm -qa|grep jdk
#卸载
rpm -e --nodeps jdk-16-16-ga.x86_64
安装jdk-1.8,无需修改环境变量
yum install -y java-1.8.0-openjdk-devel.x86_64
yum安装jenkins
参考链接
添加镜像源
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
导入jenkins公钥
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
安装
yum install -y jenkins
配置文件目录
/usr/lib/jenkins/ #jenkins安装目录,WAR包会放在这里。
/etc/sysconfig/jenkins #jenkins配置文件
/var/lib/jenkins/ #默认的JENKINS_HOME。
/var/log/jenkins/jenkins.log #日志文件
jenkins安装目录查询:rpm -ql jenkins
[root@test java]# rpm -ql jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins
/usr/lib/jenkins
/usr/lib/jenkins/jenkins.war
/usr/sbin/rcjenkins
/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins
[root@test java]#
启动jenkins
systemctl start jenkins
systemctl status jenkins
插件下载源更换
Dashboard——插件管理——高级——升级站点
#jenkins插件默认下载站点
https://updates.jenkins.io/update-center.json
#清华源
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json