如何更改jenkins主目录位置? [英] How to change the jenkins home directory location?

查看:860
本文介绍了如何更改jenkins主目录位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题:如何更改jenkins主目录位置?默认情况下,它指向/var/lib/jenkins,而我希望它指向/mnt/home/jenkins.我已将$ JENKINS_HOME更改为/mnt/home/jenkins,但这无济于事.

Simple question: How to change the jenkins home directory location? By default it points to /var/lib/jenkins whereas I want it to point to /mnt/home/jenkins. I have changed my $JENKINS_HOME to /mnt/home/jenkins but it doesn't help me.

我遇到詹金斯(Jenkins)Ui问题.参见以下错误.如果我保留相同的/var/lib/jenkins/,则可以正常工作. HTTP错误:503

I am getting jenkins Ui problem. see below error. If i leave same /var/lib/jenkins/ it's working fine. HTTP ERROR: 503

问题访问/.原因:

Service Unavailable

由Jetty://

推荐答案

如果您需要在Ubuntu中更改Jenkins主目录,请按照以下说明进行操作:

If you need to change the Jenkins home directory in Ubuntu, follow the instructions below:

Stop Jenkins 
/etc/init.d/jenkins stop

Create folder for new Jenkins home directory
mkdir home

Change access rights for this folder and all folders and files inside
sudo chown -R jenkins:jenkins home

Find current Jenkins folder and copy all directories and files into new one. If you don't know current Jenkins directory you can find it in /etc/default/jenkins file.
sudo -u jenkins cp -r /var/lib/jenkins/* home/

Change JENNIKS_HOME inside /etc/default/jenkins
sudo nano /etc/default/jenkins

find JENKINS_HOME and change path to new Jenkins home folder

Start Jenkins 
/etc/init.d/jenkins start 

In case if you have the error message 
Unable to create the home directory ‘/path/to/jenkins/home’. This is most likely a permission problem.
run the command
sudo chown -R jenkins:jenkins root_folder/

To get the root_folder you need go to Jenkins home folder and run pwd. This will work in case if you want use other one hdd (not system) for Jenkins home .
$pwd
/media/path/to/jenkins/home

In my case the root_folder is media

仅此而已.享受吧!

来源: http://www.sofment.com/?q=node/25

这篇关于如何更改jenkins主目录位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆