jenkins安装简要说明
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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
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 ;启动完成如下图所示
5、访问http://ip:9000 登录jenkins
这些插件都需要联网下载安装,如果无法联网,可以找一台联网机器下载好*.jpi,然后上传到JENKINS_HOME目录下的plugins目录
jenkins插件下载地址https://plugins.jenkins.io/ http://updates.jenkins-ci.org/download/plugins/
安装完成后,提示是否新建用户,如果不想新建用户直接点击Continue as admin
下面摘自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
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"}]}
以上是关于jenkins安装简要说明的主要内容,如果未能解决你的问题,请参考以下文章
Jenkins教程——从安装到部署Docker服务声明式流水线HelloWorld