1、首先安裝好Java
yum install -y java java -version

2. 獲取jenkins安裝源文件
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
3. 導入公鑰 (如果報錯,多執行幾次就好了)
yum -y update nss
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
4. 安裝Jenkins
yum install -y jenkins
5. 配置文件修改( 修改默認端口為8787)
vim /etc/sysconfig/jenkins

6.啟動
service jenkins start
報錯解決

yum -y install java-1.8.0-openjdk.x86_64
7.訪問安裝 http://{IP地址}:8787
8、加入開機自啟動
systemctl enable jenkins.service