赞
踩
jenkins介绍不再叙述,废话不多说,开整!!!
1、安装jenkins,两种方式
#废话一下,可略过!本人第一次用第二种装的没成功,关于/etc/rc.d/init.d/jenkins、/etc/sysconfig/jenkins文件修改(详细修改内容往下拉),依然没有任何反应,详细如下:
然后,索性卸载,采用第一种重新安装,然后...某问题了!!!
第一种:#添加Jenkins库到yum库,Jenkins将从这里下载安装。
- 1 、wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
- 2 、rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
- 3 、yum install -y jenkins
第二种:如果第一步不能安装,官网下载地址:https://pkg.jenkins.io/redhat-stable/
- 1、wget http://pkg.jenkins-ci.org/redhat-stable/jenkins-2.7.3-1.1.noarch.rpm
- 2、rpm -ivh jenkins-2.7.3-1.1.noarch.rpm
2、启动jenkins
- # 两种一样
- 1、service jenkins start/stop/restart
- 2、systemctl start jenkins
3、出现:Starting jenkins (via systemctl): Warning: jenkins.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
[FAILED]
4、修改jenkins启动配置文件
vi /etc/rc.d/init.d/jenkins
5、根据提示走 systemctl daemon-reload 命令,启动 systemctl restart jenkins 依然同上
6、修改 vi /etc/sysconfig/jenkins 配置文件
- 1、systemctl daemon-reload
- 2、systemctl restart jenkins
- #依然启动失败,继续往下
- 3、vi /etc/sysconfig/jenkins
使用命令将/var/log/jenkins、/var/lib/jenkins、/var/cache/jenkins设置所有者为root:
- # chown -R root:root /var/log/jenkins
- # chown -R root:root /var/lib/jenkins
- # chown -R root:root /var/cache/jenkins
此时,如果还是启动失败,错误信息如上,可尝试卸载,重装(我是这么干的)
- 1、rpm卸载
- rpm -e jenkins
-
- 2、检查是否卸载成功
- rpm -ql jenkins
-
- 3、彻底删除残留文件:
- find / -iname jenkins | xargs -n 1000 rm -rf
-
7、修改jenkins默认端口
vi /etc/sysconfig/jenkins
#启动成功后不能访问问题,添加防火墙规则,可参考:https://blog.csdn.net/qq_40437152/article/details/105235170,注意在你的服务器端添加安全组规则。
参考自:https://blog.csdn.net/ken1583096683/article/details/82585004
更多安装方式:https://www.cnblogs.com/cac2020/p/9799532.html
后续关于maven、git/gitlab可参考:https://www.cnblogs.com/rslai/p/8135460.html,我这里用的svn,暂时就不更了!
jenkins忘记密码问题,可参考:https://www.cnblogs.com/gclm/p/10979549.html
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。