Gerrit Multi-Master Configuration

本文档详细介绍了如何设置使用共享后端的多个 Gerrit 主服务器:共享数据库和共享 Git 仓库。多主配置使得用户可以在资源更丰富的服务器上进行访问,提供更高的可用性,当主服务器故障时,可以将服务转移到剩余的主服务器。运行多主设置本身很复杂,根据配置和外部硬件及软件的不同,可以实现不同级别的服务。
摘要由CSDN通过智能技术生成
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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值