Gerrit multi site configuration

285 views
Skip to first unread message

Jigar R

unread,
Feb 17, 2021, 2:29:14 PM2/17/21
to Repo and Gerrit Discussion
Hello Gerrit community, 

Thank you for guiding me for building a proof-of-concept for gerrit multi-site. We are thinking to use it for production. I have following questions in regards to production deployment:

Setup:
2 gerrit v3.2.6 hosts in separate data centers ( one with read-write permission and another with read-only)
As of now, we use following plugins
  • websession-broker
  • zookeeper-refdb
  • Kafka-events
  • multi-site
  • replication 

Questions:
1. How to configure one gerrit instance as read-only? As of now, in my proof-of-concept both gerrit instances are in read-write mode.
    Should I use read-only plugin https://gerrit.googlesource.com/plugins/readonly/ ? Or should I configure notedb.config with write=false?

2. Currently, I look at dashboard and count number of projects on each instances to determine whether they are in-sync or not. Is there a better way to do this? 

3. I have following config on both Gerrit instances. There is no plugin configuration page for kafka-events. Not sure about, how will plugin deal with kafka unavailability.
$ cat gerrit.config
[gerrit]
.....
.....
[plugin "kafka-events"]
    sendAsync = true
    bootstrapServers = kafka:9092
    groupId = instance-1
    numberOfSubscribers = 6
    pollingIntervalMs = 1000
    enableAutoCommit = true
    autoCommitIntervalMs = 1000
    autoOffsetReset = latest

--
Thanks,
Jigar R

Luca Milanesio

unread,
Feb 17, 2021, 4:00:32 PM2/17/21
to Jigar R, Luca Milanesio, Repo and Gerrit Discussion

On 17 Feb 2021, at 19:29, Jigar R <jigarra...@gmail.com> wrote:

Hello Gerrit community, 

Thank you for guiding me for building a proof-of-concept for gerrit multi-site. We are thinking to use it for production.

Thanks for sharing this, that looks amazing !

I have following questions in regards to production deployment:

Setup:
2 gerrit v3.2.6 hosts in separate data centers ( one with read-write permission and another with read-only)

That’s a good start I would say.
Are you then planning to go upwards to more advanced multi-site models?

As of now, we use following plugins
  • websession-broker
This isn’t mandatory for a stage #7

  • zookeeper-refdb
This isn’t mandatory for a stage #7

  • Kafka-events
  • multi-site
  • replication 
All those three are required.


Questions:
1. How to configure one gerrit instance as read-only? As of now, in my proof-of-concept both gerrit instances are in read-write mode.
    Should I use read-only plugin https://gerrit.googlesource.com/plugins/readonly/ ? Or should I configure notedb.config with write=false?

You define that in your HAProxy policies.
If you want to enforce the RO operations, you can also add the readonly plugin as you mentioned.


2. Currently, I look at dashboard and count number of projects on each instances to determine whether they are in-sync or not. Is there a better way to do this? 

The multi-site plugin publishes a metric for that:
plugins_multi_site_multi_site_subscriber_subscriber_replication_status_sec_behind

If the above metric is zero, means the instance is up-to-date, if that number is positive, the instance is behind.


3. I have following config on both Gerrit instances. There is no plugin configuration page for kafka-events.



Not sure about, how will plugin deal with kafka unavailability.
$ cat gerrit.config
[gerrit]
.....
.....
[plugin "kafka-events"]
    sendAsync = true
    bootstrapServers = kafka:9092

^^^^ you need to specify ALL the bootstrap servers there, to manage Kafka availability.

    groupId = instance-1
    numberOfSubscribers = 6
    pollingIntervalMs = 1000
    enableAutoCommit = true
    autoCommitIntervalMs = 1000
    autoOffsetReset = latest

Luca.


--
Thanks,
Jigar R

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/64477faa-2f3f-4d86-b1a5-ebafad68be66n%40googlegroups.com.

Jigar R

unread,
Feb 17, 2021, 4:58:08 PM2/17/21
to Repo and Gerrit Discussion
Hi Luca,

How can I access this metric? Is it though some command line or REST endpoint?

Luca Milanesio

unread,
Feb 17, 2021, 5:02:29 PM2/17/21
to Jigar R, Luca Milanesio, Repo and Gerrit Discussion
Gerrit metrics can be collected using one of the reporters plugins:
- Prometheus
- JMX
- Cloudwatch
- Graphite

See the list at:

HTH

Luca.


Jigar R

unread,
Feb 19, 2021, 5:44:42 PM2/19/21
to Repo and Gerrit Discussion
This is great information. It takes some time to get plugins in my company. Is it possible to see this information without plugin? 

Luca Milanesio

unread,
Feb 19, 2021, 5:48:13 PM2/19/21
to Jigar R, Luca Milanesio, Repo and Gerrit Discussion
Nope, I believe you should get your company to improve their change-management process, as exposing metrics is a primary feature of any production system and they shouldn’t block or slowdown the adoption of such plugins.

Luca.

Reply all
Reply to author
Forward
0 new messages