- Configure the former primary node to be a secondary node
- Promote the secondary node to primary node
- Restore the secondary node
Bring a demoted primary node back online
After a failover, it is possible to fail back to the demoted primary node to restore your original configuration. This process consists of two steps:
- Making the old primary node a secondary node.
- Promoting a secondary node to a primary node.
Configure the former primary node to be a secondary node
Since the former primary node will be out of sync with the current primary node, the first step is to bring the former primary node up to date. Note, deletion of data stored on disk like repositories and uploads will not be replayed when bringing the former primary node back into sync, which may result in increased disk usage. Alternatively, you can set up a new secondary GitLab instance to avoid this.
To bring the former primary node up to date:
- SSH into the former primary node that has fallen behind.
-
Make sure all the services are up:
sudo gitlab-ctl start
Note: If you disabled the primary node permanently, you need to undo those steps now. For Debian/Ubuntu you just need to runsudo systemctl enable gitlab-runsvdir
. For CentOS 6, you need to install the GitLab instance from scratch and set it up as a secondary node by following Setup instructions. In this case, you don’t need to follow the next step.Note: If you changed the DNS records for this node during disaster recovery procedure you may need to block all the writes to this node during this procedure. - Setup database replication. Note that in this case, primary node refers to the current primary node, and secondary node refers to the former primary node.
If you have lost your original primary node, follow the setup instructions to set up a new secondary node.
Promote the secondary node to primary node
When the initial replication is complete and the primary node and secondary node are closely in sync, you can do a planned failover.
Restore the secondary node
If your objective is to have two nodes again, you need to bring your secondary node back online as well by repeating the first step (configure the former primary node to be a secondary node) for the secondary node.
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc