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<
2、下载jenkins.jar包,
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、访问 登录jenkins
这些插件都需要联网下载安装,如果无法联网,可以找一台联网机器下载好*.jpi,然后上传到JENKINS_HOME目录下的plugins目录
jenkins插件下载地址
安装完成后,提示是否新建用户,如果不想新建用户直接点击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
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 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"}]}