- Bring a demoted primary node back online
After a failover, it is possible to fail back to the demoted primary to restore your original configuration. This process consists of two steps:
- Making the old primary a secondary
- Promoting a secondary to a primary
Warning: If you have any doubts about the consistency of the data on this node, we recommend to set up it from scratch.
Since the former primary will be out of sync with the current primary, the first step is to bring the former primary up to date. Note, deletion of data stored on disk like repositories and uploads will not be replayed when bringing the former primary in back into sync, which may result in increased disk usage. Alternatively, you can setup a new secondary GitLab instance to avoid this.
To bring the former primary up to date:
- SSH into the former primary that has fallen behind
Make sure all the services are up:
sudo gitlab-ctl start
Note 1: If you disabled primary permanently, you need to undo those steps now. For Debian/Ubuntu you just need to run
sudo systemctl enable gitlab-runsvdir. For CentOS 6, you need to install the GitLab instance from scratch and setup it as a secondary node by following Setup instructions. In this case you don't need to follow the next step.
Setup database replication. Note that in this case, primary refers to the current primary, and secondary refers to the former primary.
If you have lost your original primary, follow the setup instructions to set up a new secondary.
When the initial replication is complete and the primary and secondary are closely in sync, you can do a planned failover.
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 to be a secondary) for the secondary node.