1.安装jenkins
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum install jenkins
2、失败报错提示找不到java:Starting Jenkins bash: /usr/bin/java: No such file or directory
修改配置文件java目录
vim /etc/init.d/jenkins
candidates="
/usr/local/java/jdk1.8.0_144/bin/java
/etc/alternatives/java
/usr/lib/jvm/java-1.8.0/bin/java
修改端口号和用户名
[root@localhost yum.repos.d]# sudo vi /etc/sysconfig/jenkins
JENKINS_USER="root"
JENKINS_PORT="8085"
启动
systemctl daemon-reload
service jenkins start