我的基本磁盘已安装完毕,是否可以将存储库及其数据移动到其他文件夹,并确保将即将推出的数据发送到这些目录?
我尝试停止gitlab并复制整个文件夹,但无济于事。 PS - 我不是一个IT人员,我只是想看看我们怎么能摆脱这个问题;所以请在回答时详细说明。
解决方案只要更新以防人们仍然参考这一点。从GitLab 文档: $ b
默认情况下,omnibus-gitlab将Git存储库数据存储在 的/ var /选择/ gitlab / GIT-数据。存储库存储在子文件夹 存储库中。您可以通过将以下行添加到 /etc/gitlab/gitlab.rb 来更改 git-data 父目录目录的位置。
git_data_dirs({default=>/ mnt / nas / git-data })从GitLab 8.10开始,您还可以添加多个git数据目录将以下行添加到 /etc/gitlab/gitlab.rb 中。
git_data_dirs({default=>/ var / opt / gitlab / git-data,alternative=>/ mnt / nas / git-数据)请注意,目标目录及其任何子路径不得a 符号链接。
运行 sudo gitlab-ctl reconfigure 以使更改生效。 p>
如果您已经有 / var / opt / gitlab / git-data 中的现有Git存储库,您可以将它们移动到新的位置,如所示:
#防止用户在移动存储库时写入存储库。 sudo gitlab -ctl stop #请注意'repositories'后面有_no_斜线,但是在'git-data'后面有一个#斜杠。 sudo rsync -av / var / opt / gitlab / git-data / repositories / mnt / nas / git-data / #修复权限(如有必要) sudo gitlab-ctl重新配置 #仔细检查/ mnt / nas / git-data中的目录布局。预期输出:#gitlab-satellites存储库 sudo ls / mnt / nas / git-data / #完成!启动GitLab并验证您是否可以浏览#web界面中的存储库。 sudo gitlab-ctl start
my basic disk is full for my gitlab installation, is it possible to move the repositories and their data to some other folder and make sure that the upcoming push's data is sent to those directories?
I tried stopping the gitlab and copying over the entire folder, but to no avail. PS - I am not an IT guy, I am just pitching in to see how could we get out of this issue; so please be verbose when answering.
解决方案Just updating in case people still refer to this. From the GitLab documentation:
By default, omnibus-gitlab stores the Git repository data under /var/opt/gitlab/git-data. The repositories are stored in a subfolder repositories. You can change the location of the git-data parent directory by adding the following line to /etc/gitlab/gitlab.rb.
git_data_dirs({"default" => "/mnt/nas/git-data"})Starting from GitLab 8.10 you can also add more than one git data directory by adding the following lines to /etc/gitlab/gitlab.rb instead.
git_data_dirs({ "default" => "/var/opt/gitlab/git-data", "alternative" => "/mnt/nas/git-data" })Note that the target directories and any of its subpaths must not be a symlink.
Run sudo gitlab-ctl reconfigure for the changes to take effect.
If you already have existing Git repositories in /var/opt/gitlab/git-data you can move them to the new location as follows:
# Prevent users from writing to the repositories while you move them. sudo gitlab-ctl stop # Note there is _no_ slash behind 'repositories', but there _is_ a # slash behind 'git-data'. sudo rsync -av /var/opt/gitlab/git-data/repositories /mnt/nas/git-data/ # Fix permissions if necessary sudo gitlab-ctl reconfigure # Double-check directory layout in /mnt/nas/git-data. Expected output: # gitlab-satellites repositories sudo ls /mnt/nas/git-data/ # Done! Start GitLab and verify that you can browse through the repositories in # the web interface. sudo gitlab-ctl start
更多推荐
更改数据目录gitlab以在其他地方存储回购
发布评论