1.下载安装包
官网红帽稳定版:
Redhat Jenkins Packages
https://pkg.jenkins.io/redhat-stable/
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo --no-check-certificate
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
安装依赖
yum install jenkins
#找到Jenkins的war包代表安装成功了
ll /usr/lib/jenkins/
2.修改配置
修改端口号
vim /etc/sysconfig/jenkins
#修改Jenkins端口
JENKINS_PORT="xxxx"
service jenkins start
3.登陆Jenkins
cat /var/lib/jenkins/secrets/initialAdminPassword 找到密码
4.启动报错
vi /etc/init.d/jenkins
执行 systemctl daemon-reload 命令重新加载配置文件
执行 sudo service jenkins start 命令启动Jenkins
执行 systemctl status jenkins.service 命令查看Jenkins服务的状态
5.卸载
1、rpm卸载
rpm -e jenkins
2、检查是否卸载成功
rpm -ql jenkins
3、彻底删除残留文件:
find / -iname jenkins | xargs -n 1000 rm -rf