0

Me and a friend has two servers (linux/gentoo) - both has ADSL connections (16Mbit/s download - 512Kb/s upload) and they're located several hundred kilometers away.

Since our upload bandwidth is way too narrow for nowadays requirements, we decided that it would be a good idea to synchronize and load-balance them.

We're serving MediaWiki and Wordpress, using mysql replicas to replicate the databases, lsync (based on git) to sync the files and our DNS servers are resolving to both IP addresses.

It's been running for some days and we just began to experience synchronization issues - files that should be in his server that aren't and files that got erased from my server for no apparent reason;

We thought about DRDB, that synchronize the files at a lower level (DRDB doesn't synchronize file changes in a directory; we must have a new partition on both sides and DRDB will sync their blocks - which seems to be far more stable).

But there's a con - as for our understanding, DRDB doesn't seem to be able to scalable - and this is a must since we plan to have more servers in the future.

My questions are:

1) Is it possible to have lsync working seamlessly or is it just the way it is?

2) Is it there any way to make DRDB scalable? (even if it's a workaround)

3) In your opinion, what would suit my case best?

1

Cluster filesystems like DRBD solve some problems but cause plenty of new ones too.

I would suggest instead that you use NFS. Have a 'single source of truth', a single location where you store your files. Share that location to both servers over NFS. One of the servers could actually be the NFS server, so you don't need another server for it. NFS will cache the files that are accessed, so most access will be local after the initial access. It's fast, simple and easy and if it breaks it's much easier to fix than DRBD.

  • 1
    Of course, this introduces a single-point-of-failure. – ceejayoz Oct 10 '11 at 1:35
  • That is true. Just pointing out that sometimes the fancy distributed systems have their own failure modes and don't necessarily reduce your risk. – Martijn Heemels Oct 21 '11 at 16:40
0

Use Rsync if one side is the "master", or Unison if you're making changes on both sides. I assume these are the first tools you ran across with Google. Were they tried and rejected for some reason? Or are you just making life difficult for yourself?

  • or Unison, and get bidirectional sync – Javier Oct 10 '11 at 2:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.