简体   繁体   English

我可以在办公室服务器上创建一个托管的SVN存储库“并行”吗?

[英]Can I create a hosted SVN repository 'parallel' to my own on my office server?

We've been using a DIY SVN server in the office for about a year now. 我们一直在办公室里使用DIY SVN服务器大约一年了。 It's a simple setup with SVN installed on a home server. 这是一个安装在家庭服务器上的SVN的简单设置。 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. 我们使用陆龟SVN来访问它我只是希望我几年前就已经了解了一个版本控制系统..无论如何,当然在1Gbps局域网上办公室访问服务器是完美的,但外面它可用但很差,受限于50k字节/秒我们的ADSL线路上传到网络的速度。 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. 我的回购不到40G,所以100G限制就可以了。 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? 我已经在使用Svnbackup命令在我们的服务器上制作一个并行镜像,这样可以两种方式工作吗?

Any suggestions or alternatives appreciated. 任何建议或替代品赞赏。

TIA Brian TIA Brian

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. 当您只需要只读镜像时,可以使用svnsync将办公室服务器复制到镜像服务器。

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. 当你想从不同的地方提交时,看看像hg + hgsubversion或git-svn这样的分布式工具,它们都可以用作svn的异步客户端。

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. 我认为你真正需要的是一个奴隶代理 - 这是一个用于只读访问的subversion服务器的副本,当你写(对它)时,提交会直接传递给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). 网上有很多教程 ,但它们都要求你使用http访问(而不是svnserve)运行subversion。 The slave is kept up to date through the excellent svnsync and a post-commit hook. 奴隶通过优秀的svnsync和post-commit钩子保持最新。

The standard Linux SVN server has hooks that allow you to run your own scripts on events. 标准Linux SVN服务器具有允许您在事件上运行自己的脚本的挂钩。 You can use the post-commit hook (just place a script named "post-commit" in the "hooks"-directory). 您可以使用post-commit钩子(只需在“hooks”目录中放置一个名为“post-commit”的脚本)。

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. 现在,您可以只发出整个存储库的热拷贝,这很容易设置( svnadmin hotcopy from to ),并使用ssh等将存储库复制到Internet上的其他主机。 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) 您必须确保不会发生这种情况或找到锁定存储库的方法(例如在复制过程中关闭svn)
  • You need shell access to both machines 您需要对两台计算机进行shell访问

You may be able to speed things up by saving the repository to a local file and only transmit diffs to the other machine. 您可以通过将存储库保存到本地文件并仅将差异传输到另一台计算机来加快速度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM