Replication.config

913 views
Skip to first unread message

Anushree Ganjam

unread,
Oct 29, 2015, 6:19:31 AM10/29/15
to Repo and Gerrit Discussion
Hi,
Can any1 help me to write replication.config file
Now if i have a branch A in server A, I want to replication the branch A in Server B.

In Replication.config - how to mention only this branch to be replicated?
Please help with an example.


Thanks

Saša Živkov

unread,
Oct 29, 2015, 6:54:30 AM10/29/15
to Anushree Ganjam, Repo and Gerrit Discussion
On Thu, Oct 29, 2015 at 11:11 AM, Anushree Ganjam <anushre...@gmail.com> wrote:
Hi,
Can any1 help me to write replication.config file
Now if i have a branch A in server A, I want to replication the branch A in Server B.

In replication.config, instead of:

push = +refs/heads/*:refs/heads/*

specify only that single branch:

push = +refs/heads/A:refs/heads/A


 

In Replication.config - how to mention only this branch to be replicated?
Please help with an example.


Thanks

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Anushree Ganjam

unread,
Oct 30, 2015, 12:21:35 AM10/30/15
to Repo and Gerrit Discussion, anushre...@gmail.com
Thanks zivkov,
let me ask my further query.
Now i have branch A,B,C in server 15.15.15.15 and branch B in 20.20.20.20

My replication.config

[remote "My NewReplica"]
  url = 20.20.20.20:/home/gerrit2/gerrit_testsite/git/tmp_repl_mirror/${name}.git
  push = +refs/heads/A:refs/heads/A
  push = +refs/tags/*:refs/tags/*
  threads = 3
  authGroup = Public Mirror Group
  authGroup = Second Public Mirror Group


Even though there are 3 branches on 15.15.15.15 , I want to replicate only 1 branch.
How do i start the replication only for this branch?
Is my replication.config correct?

Anushree Ganjam

unread,
Oct 30, 2015, 12:32:32 AM10/30/15
to Repo and Gerrit Discussion, anushre...@gmail.com
I started the replication using the command

 ssh -p 29418 15.15.15.15 replication start A  -- Is this command correct?

A is the branch name present in server 15.15.15.15.
In the logs/replication_log -- I can see all the other branches present in the server 15.15.15.15 are getting replicated.

Also I can see an exception
org.eclipse.jgit.errors.TransportException: ger...@15.15.15.15:/home/gerrit2/gerrit_testsite_buildserver/git/tmp_replica/tmp_replica/platform/packages/apps/Calendar.git: Auth cancel
        at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159)

Caused by: com.jcraft.jsch.JSchException: Auth cancel
        at com.jcraft.jsch.Session.connect(Session.java:511)
        at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
        ... 24 more



On Thursday, October 29, 2015 at 4:24:30 PM UTC+5:30, zivkov wrote:

praveenm mulimani

unread,
Oct 30, 2015, 3:11:25 AM10/30/15
to Anushree Ganjam, Repo and Gerrit Discussion
--
Praveen M
9986069592

Anushree Ganjam

unread,
Oct 30, 2015, 1:23:13 PM10/30/15
to praveenm mulimani, Repo and Gerrit Discussion
Hi,
Yes i went through the link, But I am not clear.
How do I write the replication.config.
What is the format to write this.


Thanks
Anushree

Matthias Sohn

unread,
Oct 30, 2015, 2:23:24 PM10/30/15
to Anushree Ganjam, praveenm mulimani, Repo and Gerrit Discussion
On Fri, Oct 30, 2015 at 6:23 PM, Anushree Ganjam <anushre...@gmail.com> wrote:
Hi,
Yes i went through the link, But I am not clear.
How do I write the replication.config.
What is the format to write this.

Anushree Ganjam

unread,
Oct 31, 2015, 2:45:01 AM10/31/15
to Matthias Sohn, praveenm mulimani, Repo and Gerrit Discussion
Hi Matthias,
Thanks.
Yes, I have already read the links mentioned by you.
It is more generic way.
How do we customize so we can replicate the branch between 2 servers.
Can anyone help me with a real example of replication.config


Regards
Anushree


Anushree Ganjam

unread,
Nov 1, 2015, 1:31:05 AM11/1/15
to Matthias Sohn, praveenm mulimani, Repo and Gerrit Discussion
Hi All,
Replication works well now without errors.
Thanks for the help.
In the replication_log I can see it is successfully done.
But the code is not synced on the replicated slave server :(

replication_log


[2015-11-01 04:57:01,059] [] scheduling replication tmp_replica/platform/packages/apps/Browser:refs/heads/android-5.1.1_r24_new => ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/tmp_repl_mirror/tmp_replica/platform/packages/apps/Browser.git
[2015-11-01 04:57:01,059] [] scheduled tmp_replica/platform/packages/apps/Browser:refs/heads/android-5.1.1_r24_new => [2ec89978] push ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/tmp_repl_mirror/tmp_replica/platform/packages/apps/Browser.git to run after 15s
[2015-11-01 04:57:16,059] [2ec89978] Replication to ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/tmp_repl_mirror/tmp_replica/platform/packages/apps/Browser.git started...
[2015-11-01 04:57:16,063] [2ec89978] Push to ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/tmp_repl_mirror/tmp_replica/platform/packages/apps/Browser.git references: [RemoteRefUpdate[remoteName=refs/heads/android-5.1.1_r24_new, NOT_ATTEMPTED, (null)...813f198c25d2af657464a87ad8933010e36885d8, srcRef=refs/heads/android-5.1.1_r24_new, forceUpdate, message=null]]
[2015-11-01 04:57:35,318] [2ec89978] Replication to ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/tmp_repl_mirror/tmp_replica/platform/packages/apps/Browser.git completed in 19258 ms


But when i clone the code from 14.142.24.164 (slave server)
 -- Browser code is not modified.
Can any1 help me in this?

Anushree Ganjam

unread,
Nov 1, 2015, 1:32:35 AM11/1/15
to Matthias Sohn, praveenm mulimani, Repo and Gerrit Discussion
Replication.config looks like this

[remote "testreplica164"]
  url = ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/tmp_repl_mirror/${name}.git
  push = +refs/heads/android-5.1.1_r24_new:refs/heads/android-5.1.1_r24_new
  push = +refs/tags/*:refs/tags/*
  threads = 4



Anushree Ganjam

unread,
Nov 2, 2015, 1:32:59 AM11/2/15
to Repo and Gerrit Discussion, matthi...@gmail.com, praveen....@gmail.com
Hi,
Currenly in the replication.config.
I have changed like
[remote "testreplica164"]
  url = ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/${name}.git
  projects = tmp_replica/*
  replicationDelay = 5
  push = +refs/*:refs/*
  threads = 4


I checked in the changes to Browser.git
Now in the replication_log

[2015-11-02 06:18:29,445] [cee3d3de] Replication to ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/tmp_replica/platform/packages/apps/Browser.git started...
[2015-11-02 06:18:29,448] [cee3d3de] Push to ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/tmp_replica/platform/packages/apps/Browser.git references: [RemoteRefUpdate[remoteName=refs/heads/android-5.1.1_r24_new, NOT_ATTEMPTED, (null)...9592bb61ea39f08b5872ac374546933077b84244, srcRef=refs/heads/android-5.1.1_r24_new, forceUpdate, message=null]]
[2015-11-02 06:18:30,437] [cee3d3de] Replication to ger...@14.142.24.164:8080:/home/gerrit2/gerrit_testsite/git/tmp_replica/platform/packages/apps/Browser.git completed in 992 ms


NOT_ATTEMPTED -- What does this mean?
Is there any error in pushing to the slave server?
Even though replication shows completed -- The code is not synced in the replicated slave server.
What may be the mistake?
Please help me



Anushree Ganjam

unread,
Nov 8, 2015, 11:48:52 PM11/8/15
to Repo and Gerrit Discussion, matthi...@gmail.com, praveen....@gmail.com
Hi All,
Thanks for all your replies.
Replication is working well.

For a complete repo to be replicated.
1. Infact as we know .repo folder cannot be replicated.
2. So We need to setup mirror first on slave server
3. Then we need to setup replication on the master server to replicate the changes to slave server.


Kudos !!

- Anushree

mohit dhingra

unread,
Nov 18, 2015, 12:46:28 PM11/18/15
to Repo and Gerrit Discussion, matthi...@gmail.com, praveen....@gmail.com
Hi Anushree,

While replication , i am getting this error. 


[2015-11-17 17:05:12,343] INFO  com.googlesource.gerrit.plugins.replication.ReplicationQueue : Push to ssh://10.44.215.70/opt/gerrit/g
it/registry-webapp.git references: [RemoteRefUpdate[remoteName=refs/heads/develop, NOT_ATTEMPTED, (null)...cde2a03f9c453319886bb78a8e4
b419bdab20f6c, srcRef=refs/heads/develop, message=null]]
[2015-11-17 17:06:19,235] WARN  com.google.gerrit.sshd.GerritServerSession : Exception caught
java.io.IOException: Connection reset by peer
        at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
        at sun.nio.ch.IOUtil.read(IOUtil.java:197)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
        at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:273)
        at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:44)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:690)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:664)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:653)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1124)
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
[2015-11-17 17:07:36,095] DEBUG gerrit.py - Execute gerrit command
[2015-11-17 17:07:36,113] DEBUG ref-update.py - ref-update hook triggered
[2015-11-17 17:07:36,114] INFO ref-update.py - Write to lock file: /tmp/0000000000000000000000000000000000000000.lock
[2015-11-17 17:07:36,114] DEBUG ref-update.py - Parse configuration for project


do you have any idea why it is saying NOT_ATTEMPTED.
 my replication.config file looks like this

[remote "10.44.215.70"]
        threads = 3

Please suggest if i need to add any other line in this may be for force push  ( push = +refs/*:refs/* ) or do any other changes so that this error doesnt come for any repository.

Anushree Ganjam

unread,
Nov 18, 2015, 3:32:44 PM11/18/15
to mohit dhingra, praveenm mulimani, Matthias Sohn, Repo and Gerrit Discussion

Hi mohit,
In the error log mentioned by you,

com.google.gerrit.sshd.GerritServerSession : Exception caught

java.io.IOException: Connection reset by peer

        at sun.nio.ch.FileDispatcherImpl.read0(Native Method)

This is because port is not mentioned. Pls mention in replication.config 29418

url = ssh://10.44.215.70:29418/opt/gerrit/git/${name}.git

 
NOT_ATTEMPTED is not an issue. I am not sure what is the meaning of this.
In my case , where replication is success, I can see the same NOT_ATTEMPTED message.

Thanks
Anushree

You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/Ad82OIvWLTA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages