I have a DRBD resource, Primary and Secondary (EXT4 - No LVM)
What is the more suitable way to do a backup on the DRBD resource with compressed data and incremental backup?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
As long as it's online, you can't do a reliable backup of a DRBD secondary device , as you can't even mount the file system on it read-only. Even it it would let you mount the device (it doesn't as long as it's secondary and online), you would never get a consistent view of the file system as the ext4 driver of the secondary node has no way of seeing updates happening on the file system and it's view of things can be outdated really fast on a busy file system.
Edit: In theory, the following could work:
This is a stupid approach though, as your mirror is use- and worthless during the backup and if something happens to the primary node during this, you are screwed - why bother with DRBD in the first place if you destroy your mirror in regular interval?
Mount as read only a node is not reliable to make a backup, and this method require stop the mirror and resync after.
The solution was:
innobackupex with the "wrapper" gist.github.com/jmfederico/1495347, this backup is incremental and compressed, all tables are in InnoDB then not block in backup process.
I use Duplicity for backup the normal files (.php, .js, .css, .jpg), incremental and compressed.
After the backup is copied to other server with rsync with a wrapper gist.github.com/rcoup/5358786 for to do the a parallel copy.