Gerrit Multi-Master Configuration

Multi-Master Configuration

This document describes how to setup multiple Gerrit master servers using shared back-ends: shared DB and shared git repos. With multiple Gerrit masters it is possible to mitigate server load by allowing users to access a server which has more free resources, and it is also possible to provide higher availability by allowing service to be transferred to any remaining masters when a master fails.

Running a multi-master setup is inherently complicated and, depending on the configuration and external hardware and software available, it is possible to configure a multi- master setup with very different levels of service. Supported configuration options are outlined below.

Sharing Git Repositories

A single site multi-master arrangement generally consists of pointing all the masters to the same copy of the git repositories via a shared file system.

Simple Shared Host Test Setup

The simplest example of this is to host two gerrit servers on the same host and to point the two servers at the same directory where the git repos are located. This is likely only useful as an example for testing, since running two gerrit servers on the same host is unlikely to provide any additional load balancing or to improve availability very much. But this may be useful for those interested in understanding how a multi-master setup works since it is very easy to setup.

Sharing via a Network File System

Running each master on a separate physical host provides a load balancing improvement. A shared file system such as NFS is likely the best option for this arrangement, although any JGit supported shared file system will work.

To share the git repos, initialize the Gerrit instances as shown below:

  $ java -jar {path/}gerrit.war init -d <site1>
  # ...
  *** Git Repositories
  ***

  Location of Git repositories   [git]:  /path/to/nfs/git
  # choose any location on the network shared file system
    for git repository location.  NOTE: the location of the
    git repository must be shared by all servers.  If you
    use the default, [git], then the repository will be
    located on this server in 'site1/git'.  It is
    recommended that you avoid the default and specify the
    full path to the git repository, even if it is on this
    server.  The full path can then be used when setting up
    the other servers.
  # ...
$ java -jar {path/}gerrit.war init -d <site2>
# ...
*** Git Repositories
***

Location of Git repositories   [git]:  /path/to/nfs/git
# choose the same git repository location that the first
  instance uses
# ...
Sharing The Database

All servers must use the same database to ensure users have access to the same data. Therefore PostgreSQL or MySQL shoul

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值