Hard disk high avalibity
clint at ubuntu.com
Thu Jan 20 17:31:13 UTC 2011
On Thu, 2011-01-20 at 10:27 -0600, Dan Sheffner wrote:
> I have used rsync with cron. Since you can copy only the data that
> has changed you can run this often. I have mine set as */5 * * * *
Any syncing that does not set the filesystem readonly while it runs, or
use a snapshotting technology like LVM snapshotting, may result in
corruption for anything except single files.
Rsync, for instance, cannot run atomically over multiple files.
If you rsync a running mysql InnoDB database, you will lose a lot more
data than one might expect (its still atomic and durable, so the
database will be usable, but recovery will end up rolling back really
far). This is because while you are copying ib_logfile0, mysql has
started writing to ib_logfile1. Then you move on to ib_logfile1, and
ib_logfile0 starts getting written to again, all of those changes are
missed, and ib_logfile0 and 1 appear out of sync, so you end up with
only committed data in the database, and even possibly actual
DRBD, on the other hand, keeps two volumes in sync. the write() on the
active node does not return until, at the very least, the packet has
been sent to the backup machine. In its most durable mode (mode A), the
write() call won't even return until the data has been written to a
physical disk/ battery backed write cache on the other machine.
More information about the ubuntu-server