先来一张报错信息,真的是拉不到头。。
一、首先解决第一个问题,将插件下载地址换为国内源
官方源:https://updates.jenkins.io/update-center.json
国内源: https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json
国内源2:http://mirror.xmission.com/jenkins/updates/update-center.json
修改配置文件
- 进入jenkins安装目录下的/updates/default.json ,将其中的updates.jenkins-ci.org/download 替换为mirrors.tuna.tsinghua.edu.cn/jenkins ,
- 有些 jenkins 版本当中,是将updates.jenkins.io/download 替换为mirrors.tuna.tsinghua.edu.cn/jenkins
- 然后,把 www.google.com 修改为 www.baidu.com
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
重启jenkins
二、在解决插件安装问题的过程中,我发现我的jenkins版本过低了,导致安装的一些插件或者已安装的插件依赖的插件不兼容,所以第二个问题,升级jenkins
我这里是用docker安装的jenkins,安装可以看我之前的文章,所以要先进到jenkins容器
# 进到jenkins.war文件所在的目录
root@456fcdc45cdf:/var/jenkins_home# cd /usr/share/jenkins/
root@456fcdc45cdf:/usr/share/jenkins# ls
jenkins.war ref
root@456fcdc45cdf:/usr/share/jenkins#
root@456fcdc45cdf:/usr/share/jenkins#
root@456fcdc45cdf:/usr/share/jenkins#
# 备份原war包
root@456fcdc45cdf:/usr/share/jenkins# cp jenkins.war jenkins.war.2.328.bak
root@456fcdc45cdf:/usr/share/jenkins#
root@456fcdc45cdf:/usr/share/jenkins#
root@456fcdc45cdf:/usr/share/jenkins#
root@456fcdc45cdf:/usr/share/jenkins#
root@456fcdc45cdf:/usr/share/jenkins#
root@456fcdc45cdf:/usr/share/jenkins# ls
jenkins.war jenkins.war.2.328.bak ref
# 新建文件夹,存储新的war包
root@456fcdc45cdf:/usr/share/jenkins# mkdir other-version
root@456fcdc45cdf:/usr/share/jenkins# cd other-version/
# 下载最新的war包
root@456fcdc45cdf:/usr/share/jenkins/other-version# wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war
root@456fcdc45cdf:/usr/share/jenkins# ls
jenkins.war jenkins.war.2.328.bak other-version ref
# 删除原war包
root@456fcdc45cdf:/usr/share/jenkins# rm jenkins.war
root@456fcdc45cdf:/usr/share/jenkins# ls
jenkins.war.2.328.bak other-version ref
root@456fcdc45cdf:/usr/share/jenkins#
root@456fcdc45cdf:/usr/share/jenkins#
root@456fcdc45cdf:/usr/share/jenkins# cd other-version/
# 替换war包
root@456fcdc45cdf:/usr/share/jenkins/other-version# mv jenkins.war ../
root@456fcdc45cdf:/usr/share/jenkins/other-version#
root@456fcdc45cdf:/usr/share/jenkins/other-version#
root@456fcdc45cdf:/usr/share/jenkins/other-version# ls
root@456fcdc45cdf:/usr/share/jenkins/other-version# cd ..
root@456fcdc45cdf:/usr/share/jenkins# ls
jenkins.war jenkins.war.2.328.bak other-version ref
root@456fcdc45cdf:/usr/share/jenkins#
# 退出容器
root@456fcdc45cdf:/usr/share/jenkins# exit
[root@qa work]#
# 重启
[root@qa work]# docker restart jenkins
jenkins
jenkins下载官网:https://www.jenkins.io/download/
下载最新版本链接:http://mirrors.jenkins.io/war-stable/latest/jenkins.war
所有的war包地址:https://mirrors.tuna.tsinghua.edu.cn/jenkins/war/
文章来源:https://www.toymoban.com/news/detail-478172.html
三、替换jenkins.war文件后docker镜像文件无法启动解决方法
777 docker ps -a
778 docker cp 456f:/usr/share/jenkins/jenkins.war ./
779 ll
780 docker cp 456f:/usr/share/jenkins/jenkins.war.2.328.bak ./
781 ll
782 rm -rf jenkins.war
783 mv jenkins.war.2.328.bak jenkins.war
784 docker cp ./jenkins.war 456f:/usr/share/jenkins/jenkins.war
785 docker start 456f
786 docker ps
795 ll
796 docker ps
797 docekr logs -f 456f
798 docker logs -f 456f
799 ll
800 mv jenkins.war jenkins.war.2.328.bak
801 docker exec -it 456f bash
802 docker exec -it 456f -u root /bin/bash
803 docker exec -it jenkins -u root /bin/bash
804 rz
805 docker ps
806 docker cp ./jenkins.war 456f:usr/share/jenkins
807 docker restart 456f
808 docekr ps
809 docker ps
810 docker logs -f 456f
811 history
修复问题后截图
注:因更换了war文件,ssh凭证和java-web文件都需要重新更换,更换后重新启动即可
文章来源地址https://www.toymoban.com/news/detail-478172.html
到了这里,关于jenkins插件冲突解决以及版本升级的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!