First, bear in mind that support for multi-site on k8s-gerrit is not merged yet. Are you making your own custom deployment or using k8s-gerrit?
Hi Team,
We are implementing pull replication on Kubernetes for Gerrit in a multi-site (multi-region) setup.
Scenario:
Target Pod: This is where repositories are being pulled to.
Source Pod: This is the origin from which repositories are being pulled.
Remote URL: The URL of the source Gerrit instance.
We have two clusters in different regions with Gerrit instances running in multi-site mode, following the documentation [1].
The [1] is just about pull-replication, you should follow a full E2E multi-site sample at [2] instead.
In the target pod, the replication.config file is configured as follows:
replication.config: |-
[gerrit]
autoReload = true
replicateOnStartup = false
[replication]
lockErrorMaxRetries = 5
maxRetries = 5
useCGitClient = false
consumeStreamEvents = false
eventBrokerTopic = gerrit
syncRefs = "ALL REFS ASYNC"
maxApiPayloadSize = 40000
[remote]
url = admin@<remote_url>:/var/gerrit/git/${name}.git
apiUrl = http://<remote_url>:8080
fetch = +refs/:refs/
It would be best to use proper wrapping and newlines to make our life of reading your messages a bit easier :-)
However, I see you have on the target site:
url = admin@<remote_url>:/var/gerrit/git/${name}.git
apiUrl = http://<remote_url>:8080 fetch = +refs/:refs/
However, you haven’t shared what you have on the source site.
Also, please provide the *FULL* replication.config of either sites, not just some unformatted fragments.
When starting the pull replication from the target pod to pull repositories from the source pod use the following command:
ssh -p 29418 <target-pod_url> pull-replication start --all
The ${name} placeholder in the config file is incorrectly taking the repository names from the target pod instead of the source pod,
They should be the same isn’t it?
One basic concept of multi-site is that all nodes in all the sites are identical, or are you trying to setup multi-site between different Gerrit servers, repositories and versions?
resulting in an error (see attached screenshot).
Note: The test.git repository exists in the target pod but not in the source pod.
Could someone help us with the configuration of the same and let us know where are we going wrong?
If you help us with sharing more details and accurate information, we can help you resolve your problems :-)
HTH
Luca.
[2]
https://gerrit.googlesource.com/plugins/multi-site/+/refs/heads/master/setup_local_env/