Change the warehouse storage location
By default, the warehouse storage location of the Gitlab is "/var/opt/gitlab/git-data/repositories", in the actual production environment we will not be stored in this location, generally divided into a separate partition to store the warehouse data, I plan to store the data in the "/data/git-data" directory.
[Email protected]:~/tools# mkdir-pv/data/git-data
mkdir: The directory "/data" has been created
mkdir: The directory "/data/git-data" has been created
[Email protected]:~# chown-r git.git/data/git-data #修改创建目录的属主和属组为git用户
[Email protected]:~/tools# Cp/etc/gitlab/gitlab.rb/etc/gitlab/gitlab.rb.bak
[Email protected]:~/tools# vim/etc/gitlab/gitlab.rb
#启用git_data_dirs参数, and modify the following:
Git_data_dirs path "/data/git-data"
#并修改external_url的值修改为规划的访问域名
External_url ' Http://test.gitlab.net '
[Email protected]:~/tools# gitlab-ctl reconfigure #重新编译gitlab. rb file, using the changes that were made to take effect
After re-editing, Gitlab will automatically create a repositories file in the warehouse directory, as follows:
[Email protected]:~# ls-ld/data/git-data/repositories/
DRWXRWS---2 git git 4096 January 4 14:15/data/git-data/repositories/
Linux Change Gitlab storage location