Slave Gerrit as replication target

942 views
Skip to first unread message

Olivier Croquette

unread,
Sep 26, 2011, 8:20:41 AM9/26/11
to Repo and Gerrit Discussion, ocroq...@free.fr
Hello,

I am trying to set up a slave Gerrit instance as a fail-over of the
main server, and I am currently a bit confused:

1)
According to :
http://gerrit.googlecode.com/svn/documentation/2.2.1/pgm-daemon.html
--slave
Run in slave mode, permitting only read operations by clients.
Commands which modify state such as
recieve-pack (creates new changes or updates existing ones) or review
(sets approve marks) are disabled.

According to this documentation, the slave cannot be a target for the
replication (read-only ; no receive packs).
Is that really what is meant ?

2)
assuming the doc is wrong, and it is possible to push to a slave as
part of the replication process, how does the slave knows from where
to accepts pushes ? Is that done with SSH keys ?

3)
According to:
http://gerrit.googlecode.com/svn/documentation/2.2.1/config-replication.html
The configuration looks like:
[remote "pubmirror"]
url = mirror1.us.some.org:/pub/git/${name}.git
Shall the url contain the site path of the master ? I would clearly
prefer not, it creates an unnecessary dependency from the master to
the slave.


Thanks !

Regards

Olivier

Magnus Bäck

unread,
Sep 26, 2011, 9:05:17 AM9/26/11
to Repo and Gerrit Discussion
On Monday, September 26, 2011 at 14:20 CEST,
Olivier Croquette <ocroq...@free.fr> wrote:

> I am trying to set up a slave Gerrit instance as a fail-over of the
> main server, and I am currently a bit confused:
>
> 1)
> According to :
> http://gerrit.googlecode.com/svn/documentation/2.2.1/pgm-daemon.html
> --slave
> Run in slave mode, permitting only read operations by clients.
> Commands which modify state such as
> recieve-pack (creates new changes or updates existing ones) or review
> (sets approve marks) are disabled.
>
> According to this documentation, the slave cannot be a target for the
> replication (read-only ; no receive packs).
> Is that really what is meant ?

Yes, as this pertains to the Gerrit SSH daemon typically listening to
connections on port 29418. Replication to slave servers takes place
behind Gerrit's back via the regular SSH port.

> 2)
> assuming the doc is wrong, and it is possible to push to a slave as
> part of the replication process, how does the slave knows from where
> to accepts pushes ? Is that done with SSH keys ?

Yes. As indicated in one of the first paragraphs of
config-replication.html, set up a passwordless keypair.

> 3)
> According to:
> http://gerrit.googlecode.com/svn/documentation/2.2.1/config-replication.html
> The configuration looks like:
> [remote "pubmirror"]
> url = mirror1.us.some.org:/pub/git/${name}.git
> Shall the url contain the site path of the master ? I would clearly
> prefer not, it creates an unnecessary dependency from the master to
> the slave.

Sorry, I don't think I'm following. Do you feel it's a problem to have
the master's ${name} (i.e. the name of each project) used as the push
destination on the slave?

--
Magnus Bäck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Olivier Croquette

unread,
Sep 26, 2011, 9:58:24 AM9/26/11
to Repo and Gerrit Discussion
On Sep 26, 3:05 pm, Magnus Bäck <magnus.b...@sonyericsson.com> wrote:
> Yes, as this pertains to the Gerrit SSH daemon typically listening to
> connections on port 29418. Replication to slave servers takes place
> behind Gerrit's back via the regular SSH port.

OK, thanks. I expected actually a mode in which Gerrit would be a
slave while still being able to receive replication from the master.
Doing that with the system SSH/Git is quite cumbersome, since Gerrit
has everything required to take this role.
Are there any plans for a slave mode in Gerrit that would allow to
receive replications ?

> > assuming the doc is wrong, and it is possible to push to a slave as
> > part of the replication process, how does the slave knows from where
> > to accepts pushes ? Is that done with SSH keys ?
>
> Yes. As indicated in one of the first paragraphs of
> config-replication.html, set up a passwordless keypair.

If a 'slave-replication" mode was available in Gerrit, the keys would
have to be available in Gerrit.


> > The configuration looks like:
> > [remote "pubmirror"]
> >   url = mirror1.us.some.org:/pub/git/${name}.git
> > Shall the url contain the site path of the master ? I would clearly
> > prefer not, it creates an unnecessary dependency from the master to
> > the slave.
>
> Sorry, I don't think I'm following. Do you feel it's a problem to have
> the master's ${name} (i.e. the name of each project) used as the push
> destination on the slave?

If a 'slave-replication" mode was available in Gerrit, then Gerrit
would add the site path automatically, and I could use here:

url = mirror1.us.some.org:${name}.git
instead of :
url = mirror1.us.some.org:<SITE_PATH>/git/${name}.git

E.g. the master configuration would not be depending on the paths used
locally in the slave.

Magnus Bäck

unread,
Sep 26, 2011, 10:17:53 AM9/26/11
to repo-d...@googlegroups.com
On Monday, September 26, 2011 at 15:58 CEST,
Olivier Croquette <ocroq...@free.fr> wrote:

> On Sep 26, 3:05 pm, Magnus Bäck <magnus.b...@sonyericsson.com> wrote:
>
> > Yes, as this pertains to the Gerrit SSH daemon typically listening
> > to connections on port 29418. Replication to slave servers takes
> > place behind Gerrit's back via the regular SSH port.
>
> OK, thanks. I expected actually a mode in which Gerrit would be a
> slave while still being able to receive replication from the master.
> Doing that with the system SSH/Git is quite cumbersome, since Gerrit
> has everything required to take this role.

I don't know if I'd call setting up an SSH keypair "very cumbersome",
but yes, it seems like a reasonable feature.

> Are there any plans for a slave mode in Gerrit that would allow to
> receive replications ?

I don't believe this has been discussed on the list at least.

[...]

> > Sorry, I don't think I'm following. Do you feel it's a problem to
> > have the master's ${name} (i.e. the name of each project) used as
> > the push destination on the slave?
>
> If a 'slave-replication" mode was available in Gerrit, then Gerrit
> would add the site path automatically, and I could use here:
>
> url = mirror1.us.some.org:${name}.git
> instead of :
> url = mirror1.us.some.org:<SITE_PATH>/git/${name}.git
>
> E.g. the master configuration would not be depending on the paths used
> locally in the slave.

Oh, right. But specifying a relative path should help somewhat, no? Then
the only dependency is the relative path to the root directory from the
replication user's $HOME.

Reply all
Reply to author
Forward
0 new messages