centos 6.9 + JenKins 安装记录
环境:
[root@localhost ~]# cat /etc/issue
CentOS release 6.9 (Final)
Kernel \r on an \m
第一步:检查发现系统自带java环境
[root@localhost ~]# java -version
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
第二步:配置JDK环境路径
[root@localhost ~]# vi /etc/profile
添加以下内容 注意对应自己系统里的版本
JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.x86_64
JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-3.b14.el6_9.x86_64/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME
export JAVA_HOME
export JRE_HOME
export PATH
[root@localhost ~]# source /etc/profile
[root@localhost ~]# echo $JAVA_HOME
/usr/lib/jvm/jre-1.8.0-openjdk.x86_64
[root@localhost ~]#
第三步:安装JenKins
1.下载源
[root@localhost ~]# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
[root@localhost ~]# rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
2.yum安装
[root@localhost ~]# yum install jenkins
3.修改端口(可选默认端口为8080)
[root@localhost ~]# diff /etc/sysconfig/jenkins.bak /etc/sysconfig/jenkins
56c56
< JENKINS_PORT="8080"
---
> JENKINS_PORT="9000"
4.启动jenkins服务
[root@localhost ~]# service jenkins start
Starting Jenkins [ OK ]
[root@localhost ~]# ss -lntp|grep 9000
LISTEN 0 50 :::9000 :::* users:(("java",1738,159))
第四步:登录jenkins
浏览器输入:http://192.168.12.128:9000/