CentOS7离线安装Jenkins

1、下载地址,下载war,上传到linux服务器/usr/local/jenkins目录下

https://jenkins.io/zh/download/

2、运行jenkins

(1)java -jar jenkins.war

(2) java -Xms256m -Xmx512m -Xmn256m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=128m -Dhudson.util.ProcessTree.disable=true -Djava.awt.headless=true -Djavax.net.ssl.trustStore=/etc/pki/ca-trust/extracted/java/cacerts -jar /jenkins/jenkins.war --httpPort=809

(3)通过tomcat部署

3、修改配置

vim /etc/sysconfig/jenkins.rpmsave

修改内容:

        (1)JENKINS_USER="jenkins"   --》  JENKINS_USER="root"

        (2)JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"   -------》

        JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Djavax.net.ssl.trustStore=/etc/pki/ca-trust/extracted/java/cacerts"

        (3)JENKINS_PORT="8080"   --》  JENKINS_PORT="7777"

4、修改为国内清华源镜像

vim /root/.jenkins/hudson.model.UpdateCenter.xml

​​​​​​​https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.jsonicon-default.png?t=M0H8http://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json

5、修改default.json

#查找default.json文件

find / -name "default.json"

#执行以下语句进行替换

sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json 
 
sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json 

6、jdk证书问题

报错处理:

1、证书问题

​​​​​​(240条消息) Jenkins安装插件一直失败,报错SunCertPathBuilderException的解决方案_ju_362204801的博客-CSDN博客https://caoju.blog.csdn.net/article/details/120498306?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2~default~CTRLIST~Rate-1.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2~default~CTRLIST~Rate-1.pc_relevant_default&utm_relevant_index=1

2、插件安装报错

(240条消息) jenkins不能下载插件报错...certpath.SunCertPathBuilderException: unable to find valid certification path解决_阿来小同学的博客-CSDN博客https://blog.csdn.net/skybboy/article/details/110818699

你可能感兴趣的:(DevOps,jenkins,运维)