Professional Documents
Culture Documents
HA solutions range from a cheap and simple back-up to highly complex and
costly master-master configurations. When it comes to HA, there is unfortu-
nately no way to split between an increase in complexity and an increase in
cost.
We recommend that you thoroughly analyze the benefits of an HA solution
against its costs. Most organizations select a High Availability solution for
GitLab that is less complex than the one they use for their primary customer-
facing infrastructure that directly generates revenue. It is important that
you always choose something that you have experience with and will
test regularly. A badly implemented HA solution causes more downtime than
it solves. For example the DRBD user guide states:
Maturity levels
It is possible to create a split between the application server, the file system
and the DBMS. If resources are available, you can use a load balancer to assign
tasks to multiple application servers. This way, if one of the application servers
fails, the workflow is not interrupted, and at most the workflow gets slower as
the load is shared between less machines.
The setup is described in the below picture.
This solution also requires a shared file system (NFS), so it is only available
for GitLab versions 6.0 and up. At this point, you should consider putting
the filesystem storage and DBMS on separate machines as well. Moreover, the
filesystem storage and the DBMS will need recovery protocols on their own
(through snapshots or backups).
If you only want to use two machines for your HA solution, we recom-
mend keeping one as a slave of the other. In this situation, each machine
has the full GitLab repositories, configuration, and the database. The slave
server is a copy of the master. You can use Distributed Replicated Block De-
vice (DRBD) to ensure that all data from the master is replicated to the slave
in a timely manner.
Manual failover is done by mounting the file storage on the slave, which is turned
into a master. At this point, the unavailable server should be turned off or taken
off the network, to avoid it coming online with master status.
This option is feasible both for users who want to keep their slave server in the
same data center, or if they want it in a different geographical location.
Users will still connect via the load balanced application servers, but the filesys-
tem storage and the DBMS are copied to a slave server(s) in the same datacen-
ter or in another location. Distributed Replicated Block Device (DRBD) can
be used to pass data from the master filesystem storage and DBMS servers to
the slaves.
There is very little state on the application server in GitLab, so we dont rec-
ommend having a slave application server alongside the filesystem storage and
the DBMS. Using a load balancer results in the same workflow impact, but in
a more simple manner.
Automated failover can be achieved with pacemaker alongside STONITH net-
work management. Keep in mind that application servers need to be prepared
for transitioning to the new network addresses.
In this situation you can also opt to synchronize the database via a database
specific protocol instead of DRBD. In the documentation for each database you
can find out more about the options for MySQL and the options for PostgreSQL.
HA package product
Were working on packages for this, feel free to comment in the issue.
GitLab GEO
GitLab GEO is not a high-availability solution per se. It does bring the possi-
bility to read git repos when the main server is down. You cant fail over to
this secundary server.
Since the release of version 8.5, GitLab GEO allows you to have a remote replica
of your entire GitLab instance. This consists of a master server that runs GitLab
Enterprise Edition, and slave servers with GitLab GEO where you can only
read Git repositories. This is for example useful when you have a large number
of people or CI tools cloning repositories and your wide area network (WAN)
doesnt have the capacity or availability for this. Please contact our sales people
for more information, and see our technical documentation for more details.
technical documentation on this topic as well. If you have any questions please
email us at sales@gitlab.com.