Skip to content

Instantly share code, notes, and snippets.

@alces
Last active September 18, 2015 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alces/191db342ae58a5bc9d72 to your computer and use it in GitHub Desktop.
Save alces/191db342ae58a5bc9d72 to your computer and use it in GitHub Desktop.
A memo on how to put all the installation of gitlab into a common root (e.g. for running a high-available solution on top of DRBD filesystem).

Putting all the Gitlab-related files into one directory prefix

  1. stop gitlab:
gitlab-ctl stop
  1. move /var/opt/gitlab inside our prefix:
mv /var/opt/gitlab /opt/gitlab/data
ln -s /opt/gitlab/data /var/opt/gitlab
  1. set the git_data_dir in /etc/gitlab/gitlab.rb, because this path couldn't content symlinks:
git_data_dir "/opt/gitlab/data/git-data"

and re-create configuration files (the first run of gitlab-ctl reconfigure after a major change often fails):

gitlab-ctl reconfigure || gitlab-ctl reconfigure
  1. move /var/log/gitlab there:
mv /var/log/gitlab /opt/gitlab/logs
ln -s /opt/gitlab/logs /var/log/gitlab
  1. and finally, move /etc/gitlab under the prefix, and start gitlab:
mv /etc/gitlab /opt/gitlab/conf
ln -s /opt/gitlab/conf /etc/gitlab
gitlab-ctl start

tested against omnibus-gitlab-ce-7.14.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment