centos安装jenkins
2020-03-13 本文已影响0人
may505
1、下载
找到jenkins官网https://pkg.jenkins.io/redhat-stable/选择rpm包下载

选择版本右键复制下载链接
wget https://prodjenkinsreleases.blob.core.windows.net/redhat/jenkins-2.225-1.1.noarch.rpm
2、安装
rpm -ivh jenkins-2.225-1.1.noarch.rpm
在安装过程中可能会报错

这时删除/etc/sysconfig/jenkins然后在重新执行一遍安装命令,安装好后启动jenkins
systemctl start jenkins
然后输入ip:8080就可以访问了
查看jenkins配置,里面可以看到权限、端口等一系列的jenkins默认配置。也可以对应进行修改
cat /etc/sysconfig/jenkins
如果启动了jenkins访问不到话可以看看jenkins服务是否启动
systemctl status jenkins

状态是runing状态
在看看是不是防火墙对8080端口做了处理,没有开放8080端口一般只是默认开放了80端口
firewall-cmd --list-ports

防火墙没有运行,查看一下防火墙的状态
systemctl status firewalld

处于关闭状态。所以先要启动一下防火墙
systemctl start firewalld

在使用firewall-cmd --list-ports命令查看是否有8080端口,如果没有把8080端口添加进去
firewall-cmd --permanent --zone=public --add-port=8080/tcp
然后重启firewall
systemctl restart firewalld
使用firewall-cmd --list-ports命令查看是否有8080端口,如果有了的话在浏览器中输入地址看看,根据提示一键安装就行
