6

We've been using a DIY SVN server in the office for about a year now. It's a simple setup with SVN installed on a home server. We use tortoise SVN to access it I just wish I'd learnt about a version contol system years ago.. Anyway, of course access to the server is perfect in the office on the 1Gbps LAN but outside it's useable but poor, limited by the 50k bytes/sec upload speed of our ADSL line to the web. I guess this may improve one day with 'infinity' but we may die waiting.

I'd like to have a 'parallel' repository hosted, for which I realise I shall pay, where access is much faster. This would also give us an additional backup. My repo is just under 40G, so a 100G limit would be ok. Is there a way of doing this and making the two as mirrors such that commits (small at least) are visible on both almost immediately? I'm alreadyusing the Svnbackup command to make a parallel mirror on our server so can this work both ways?

Any suggestions or alternatives appreciated.

TIA Brian

Brian Frost
  • 13,334
  • 11
  • 80
  • 154

3 Answers3

2

Do you want a read-only server, or read+write access to more than one server? When you only need a read-only mirror, you can use svnsync to replicate your office server to a mirror server.

When you want to commit from different places, have a look at a distributed tool like hg+hgsubversion or git-svn, which both can be used as asynchronous clients for svn.

Rudi
  • 19,366
  • 3
  • 55
  • 77
  • Thanks. Read-write please. My main use of the www mirror would be when at home (or out of the office). – Brian Frost Feb 05 '11 at 11:19
  • 1
    @Brian You can not (easily) set up a multi-master svn server cluster, since the data model of svn does not allow this. You can place the central server in the internet, which causes a performance loss in your office. You need to decide yourself if tis performance loss is acceptable for you. An alternative is to use mercurial or git as svn client, since these tools allow you to work offline. But the DVCS approach works only when you don't need features like file locking or partial tree checkouts. – Rudi Feb 05 '11 at 12:35
1

What I think you really need is a slave proxy - this is a copy of a subversion server for read-only access, when you write (to it), the commits are passed straight to the master. As you read a lot more than write, this provides a simple but effective way to achieve what you want.

There's plenty of tutorials on the web, but they all require you to run subversion using http access (not svnserve). The slave is kept up to date through the excellent svnsync and a post-commit hook.

gbjbaanb
  • 51,617
  • 12
  • 104
  • 148
0

The standard Linux SVN server has hooks that allow you to run your own scripts on events. You can use the post-commit hook (just place a script named "post-commit" in the "hooks"-directory).

Now you can either just issue a hotcopy of the entire repository, which is rather easy to setup (svnadmin hotcopy from to) and copy the repository to the other host on the internet using ssh or the like. You can do this on both machines and you are good.

Drawbacks:

  • If your repository is big, then this takes lots of time
  • Beware of the possibility that someone commits to one repository and someone else to the other repository simultaneously. This could well corrupt everything. You must make sure that this does not happen or find a way lock your repository (like shut down svn during the copying process)
  • You need shell access to both machines

You may be able to speed things up by saving the repository to a local file and only transmit diffs to the other machine.

yankee
  • 38,872
  • 15
  • 103
  • 162