# Centos7安装Jenkins并配置使用

# 安装jdk

rpm -ivh jdk-21_linux-x64_bin.rpm

# 清华源,获取jenkins安装包,并执行安装

wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat/jenkins-2.346-1.1.noarch.rpm --no-check-certificate
rpm -ivh jenkins-2.346-1.1.noarch.rpm

wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat/jenkins-2.489-1.1.noarch.rpm --no-check-certificate
rpm -ivh  jenkins-2.489-1.1.noarch.rpm

wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.479.2-1.1.noarch.rpm --no-check-certificate
rpm -ivh  jenkins-2.479.2-1.1.noarch.rpm

# 初始访问地址

http://localhost:8080

# 修改启动jenkins的用户和工作路径

vim /usr/lib/systemd/system/jenkins.service

jenkins01

jenkins02

# 查看初始密码

cat /var/lib/jenkins/secrets/initialAdminPassword

# 查看状态

systemctl daemon-reload
systemctl status jenkins
systemctl start jenkins
systemctl enable jenkins
systemctl stop jenkins
systemctl restart jenkins
Last Updated: 12/24/2024, 2:00:25 AM