Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup "git cluster"

We are thinking of changing our source version control system from Subversion to Git. We're pushing the limits on our current setup and think we'll be better of working with git.

We've always used a primary server in the office, and a mirror running at our datacenter. The mirror is configured to proxy incoming commits to the primary server. This way the two machines operated as if it was a single repository, enabling us to commit to the office machine when we are in the office or to the datacenter machine when we are somewhere else.

Having two machines is saving us alot of bandwidth and increases speed, which for us is important because we use subversion as our primary deployment tool too.

Recently we acquired a development shop in India and they will be working on the same code. Because of bandwidth limits and latency issues, having a mirror in India would be very convenient too.

As we are switching to Git, we are looking for a similar setup. How can I make multiple git repositories act as one? Ideally I'd like commits to a repository to automatically propagate to the other servers for the same repository.

like image 684
bcx Avatar asked Nov 14 '22 02:11

bcx


1 Answers

Latency won't be an issue for you in general because you'll commit locally. You may not need to do anything at all. Pushes and pulls can get slower, though. If that bothers you, there are lots of things you can do.

We use github as our "authoritative" tree, but we don't push there (our code review system does) and our builders (and some developers) don't pull from there.

Every push to github fires a post-receive hook to one or more instances of my gitmirror project which does an immediate mirror fetch. These mirrors are generally always updated within about a second of github. If anything happens to the central repo, it's quite possible others won't even notice it.

like image 96
Dustin Avatar answered Dec 09 '22 13:12

Dustin