gitlab のデータディレクトリを変更してリポジトリを別の場所に保存する 質問する

gitlab のデータディレクトリを変更してリポジトリを別の場所に保存する 質問する

私の gitlab インストール用の基本ディスクがいっぱいです。リポジトリとそのデータを他のフォルダーに移動し、今後のプッシュのデータがそれらのディレクトリに送信されることを確認することは可能ですか?

GitLab を停止してフォルダ全体をコピーしてみましたが、効果はありませんでした。追伸 - 私は IT 担当者ではありません。この問題を解決する方法を見つけるために協力しているだけです。回答の際は詳しく書いてください。

ベストアンサー1

まだ参照している人がいたら更新します。GitLabよりドキュメンテーション:

デフォルトでは、omnibus-gitlab は Git リポジトリ データを に保存します/var/opt/gitlab/git-data。リポジトリはサブフォルダ に保存されます。に次の行を追加することで、親ディレクトリrepositoriesの場所を変更できます。git-data/etc/gitlab/gitlab.rb

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-data"
})

ターゲット ディレクトリとそのサブパスはシンボリック リンクであってはならないことに注意してください。

sudo gitlab-ctl reconfigure変更を有効にするには実行してください。

既存の Git リポジトリがすでにある場合は、/var/opt/gitlab/git-data次のようにして新しい場所に移動できます。

# 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

おすすめ記事