1 Jenkins需要JDK依赖,所以先安装JDK1.8
yum install java-1.8.0-openjdk* -y
java -version #查看安装版本 是否成功安装
安装的目录为:/usr/lib/jvm
2 下载Jenkins
官网下载地址:http://mirrors.jenkins-ci.org/redhat/
3 把刚才下载的rpm包上传到服务器中安装
rpm -ivh jenkins-2.323-1.1.noarch.rpm
如果出现\警告:jenkins-2.319-1.1.noarch.rpm: 头V4 RSA/SHA512 Signature, 密钥 ID 45f2c3d5: NOKEY 错误:依赖检测失败:
daemonize 被 jenkins-2.319-1.1.noarch 需要安装
yum -y install epel-release
yum -y install daemonize
4修改jenkins配置
vim /etc/sysconfig/jenkins
修改内容如下
JENKINS_USER="root"
JENKINS_PORT="8888"
5 启动Jenkins
systemctl start jenkins
systemctl enable jenkins
6 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld