说明:
Jenkins安装完成Job默认工作空间目录是:/var/lib/jenkins
一般var的空间几十G,所以修改默认工作空间。
-
查看Jenkins安装信息 命令:rpm -ql jenkins
[root@localhost jenkins]# rpm -ql jenkins /etc/init.d/jenkins /etc/logrotate.d/jenkins /etc/sysconfig/jenkins /usr/lib/jenkins /usr/lib/jenkins/jenkins.war /usr/sbin/rcjenkins /var/cache/jenkins /var/lib/jenkins /var/log/jenkins
/usr/lib/jenkins/ :安装目录war包
/etc/sysconfig/jenkins:jenkins配置文件
/var/lib/jenkins:工作目录JENKINS_HOME
/var/log/jenkins/jenkins.log:日志文件 -
关闭Jenkins 命令:service jenkins stop
vim /etc/sysconfig/jenkins
/var/lib/jenkins 修改成要更换的目录;存储比较大的目录 -
加载配置:systemctl daemon-reload
启动:service jenkins start -
重新启动浏览器访问报如下错误
没有权限
做如下修改:vim /etc/sysconfig/jenkins
JENKINS_USER=“root” -
重新启动:service jenkins restart