AW: [DRBD-user] Re: file replication between sites
Martin Bene
martin.bene at icomedias.com
Thu Mar 8 22:20:29 CET 2007
Hi Dan,
> You could probably also run multiple instances of csync2 on a
> server in order to speed up replication if data can be
> properly segregated. You will of course have the lag between
> the time someone opens up a DWG file and the time the lock
> files get to the other server.
I don't think this is the best approach - why not use the csync2 hint
facility with inotify?
I'm using csync2 to keep two fileservers with ~500.000 files totaling
400GB in sync; normal sync is rather slow for this setup, scanning these
500.000 files for changes _does_ take some time.
However: on a linux box with inotify support compiled into the kernel
you can feed csync2 with filesystem notification events and then have
csync2 just check & sync these files/directories instead of scanning the
whole fileserver.
You can use something like
/usr/bin/inotifywait --format '%w%f' -qmr -e CLOSE_WRITE \
-e CREATE -e DELETE -e MOVE -e ATTRIB /data/ 2>&1 | \
xargs -L 1 /usr/sbin/csync2 -h 2>/dev/null &
to feed the csync2 hints table and then run
csync2 -cu
Every minute or so. Works quite well for me. For even faster syncs, you
could try adding the actual sync to the action triggered by inotify -
haven't played with that yet, 1 sync/minute is good enough for me.
Bye, Martin
More information about the drbd-user
mailing list