jenkins安装简要说明

1、配置JAVA环境变量

# mkdir /usr/local/java/ –p  
# cd /usr/local/java/  
# tar zxvf /data/elk5.0/jdk-8u111-linux-x64.tar.gz  
   
# cat >>/etc/profile<<EOF  
   
export JAVA_HOME=/usr/local/java/jdk1.8.0_111  
export PATH=$PATH:$JAVA_HOME/bin  
exportCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar  
EOF  
   
# source /etc/profile  
# java -version  
java version "1.8.0_111"  
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)  
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixedmode)

 

2、下载jenkins.jar包,https://jenkins.io/index.html

image

 

 

3、配置JENKINS_HOME,如果不配置JENKINS_HOME,默认JENKINS_HOME为用户家目录

# echo "export JENKINS_HOME=/data/PRG/jenkins" >>/etc/profile
# source /etc/profile
# echo $JENKINS_HOME
/data/PRG/jenkins

 

4、启动jenkins

java -jar jenkins.war --httpPort=9000

--httpPort=9000  指定启动端口,默认为8080 ;启动完成如下图所示

image

 

5、访问http://ip:9000 登录jenkins

 

image

image

 

image

 

这些插件都需要联网下载安装,如果无法联网,可以找一台联网机器下载好*.jpi,然后上传到JENKINS_HOME目录下的plugins目录

jenkins插件下载地址https://plugins.jenkins.io/    http://updates.jenkins-ci.org/download/plugins/

image

image

 

安装完成后,提示是否新建用户,如果不想新建用户直接点击Continue as admin

image

image

 

image

 

 

下面摘自jenkins官网

 

RedHat Linux RPM packages for Jenkins

To use this repository, run the following command:

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

If you've previously imported the key from Jenkins, the "rpm --import" will fail because you already have a key. Please ignore that and move on.

With that set up, the Jenkins package can be installed with:

yum install jenkins

See Wiki for more information, including how Jenkins is run and where the configuration is stored, etc.

 

遇到问题:

1、在配置salt api的时候有个问题: 当saltapi配置https认证后,使用curl可以认证通过,但是在jenkins上配置上https后测试连接无法认证,提示:

Client error: Auth Error: net.sf.json.JSONException: JSONObject["return"] is not a JSONArray.
{"Error": "javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present

image

image

image

curl -sSk https://192.168.62.200:8000/login      -H 'Accept: application/json'      -d username=kbson      -d password=kbson      -d eauth=pam
{"return": [{"perms": [".*", "@wheel", "@runner"], "start": 1487137658.205297, "token": "3f04e0a8918f309ee8364eacd5bd3c239d77b86f", "expire": 1487180858.2052979, "user": "kbson", "eauth": "pam"}]}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值