Git mirror & Slave server Configuration

691 views
Skip to first unread message

praveenm

unread,
May 9, 2013, 4:12:20 AM5/9/13
to repo-d...@googlegroups.com

Hello All,

We have some confusion in setting up git mirror & slave servers configuration .

We want to know the difference between mirror & slave configuration.

Appreciate if someone explains Git mirror & Git slave server configuration in detail


Thanks
Praveen

Magnus Bäck

unread,
May 9, 2013, 8:37:24 AM5/9/13
to repo-d...@googlegroups.com
On Thursday, May 09, 2013 at 04:12 EDT,
By mirror, are you talking about a mirror configuration as used by the
Repo tool? Assuming yes for now.

A (Repo) mirror is a local directory that can be used to quickly
initialize a source workspace by using Git's alternates feature, whereby
a Git repository is set up to read not only from its .git directory but
also from another location. This makes clones blazingly fast. A mirror
is typically maintained with a cron job that keeps the mirror reasonably
up to date (e.g. by fetching from the remote every morning). The server
will still get requests, but since the Git being cloned can use objects
from the mirror it'll only need to fetch whatever is new since the
mirror was synced (e.g. the last day's updates).

A slave server is a Git server (possibly Gerrit-based) to which the
master Gerrit server continuously pushes all updates. This allows
clients to do all reading from the slave server and therefore avoid
hitting the master server for anything except write operations (i.e.
pushes) and interactions with the web UI. This is useful both for
load balancing and increasing performance by placing slave servers
closer to the users (think organization distributed in various sites
with limited bandwidth and/or high latency links).

--
Magnus Bäck
ba...@google.com

praveenm mulimani

unread,
May 10, 2013, 2:36:31 AM5/10/13
to repo-d...@googlegroups.com
Thanks Baeck for your quick reply.

1. We are using second option A slave server is a Git server (possibly Gerrit-based) as you explained.

Presently we have setuped like below for load balancing and increasing performance

Server A is Master

B       C      D           E         F  ........ are slave servers..................


2. We are  not talking about the repo mirror . We want to setup Mirror for GIt Maser server so that if GIT Master Server fails One more server (Mirror) we can use as Master... or Please explain us how to Backup  GIt Master server ....


Server A is GIT Master         |  Server B is Mirror of Master server A


if A fails so that we can switch over to B as master

Thanks
Praveen





--
--
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/groups/opt_out.





--
Praveen M
9986069592

Magnus Bäck

unread,
May 10, 2013, 9:10:59 AM5/10/13
to repo-d...@googlegroups.com
On Friday, May 10, 2013 at 02:36 EDT,
praveenm mulimani <praveen....@gmail.com> wrote:

[...]

> 2. We are not talking about the repo mirror . We want to setup Mirror
> for GIt Maser server so that if GIT Master Server fails One more
> server (Mirror) we can use as Master... or Please explain us how to
> Backup GIt Master server ....
>
>
> Server A is GIT Master | Server B is Mirror of Master server A
>
>
> if A fails so that we can switch over to B as master

If you replicate all Git data from A to B and have an external
shared database used by both A and B, you can make B go live by
just reconfiguring it as a master.

However, because Gerrit stores state in both Gits and in the database
(and Git replication is asynchronous) there's no guarantee that B is
consistent at any point in time. If you have the option of gracefully
shutting down A (draining write requests and making sure replication
completes) I think you can expect it to succeed, but I'm assuming you
want a way out when disaster strikes and that's more difficult.

--
Magnus Bäck
ba...@google.com
Reply all
Reply to author
Forward
0 new messages