Note: This is not officially supported yet, please don't use as your only Disaster Recovery strategy as you may lose data.
GitLab Geo replicates your database and your Git repositories. We will support and replicate more data in the future, that will enable you to fail-over with minimal effort, in a disaster situation.
See current limitations for more information.
We don't provide yet an automated way to promote a node and do fail-over,
but you can do it manually if you have
root access to the machine.
You must make the changes in the exact specific order:
- Take down your primary node (or make sure it will not go up during this process or you may lose data)
- Wait for any database replication to finish
- Promote the Postgres in your secondary node as primary
- Log-in to your secondary node with a user with
Open the interactive rails console:
sudo gitlab-rails consoleand execute:
List your primary node and note down it's id:
Turn your primary into a secondary:
List your secondary nodes and note down the id of the one you want to promote:
To promote a node with id
Now you have to cleanup your new promoted node by running:
And refresh your old primary node to behave correctly as secondary (assuming id is
To exit the interactive console, type:
Rsync everything in
/var/opt/gitlab/gitlab-rails/sharedfrom your old node to the new one.