[Users] ZCS OSE Hot DR Solutions

David Sommerseth dazo at eurephia.org
Tue Sep 27 10:13:42 CEST 2016


On 27/09/16 06:26, Truong Anh Tuan wrote:
> On 09/27/2016 02:42 AM, Andrew Martin wrote:
>> Hello,
>>
>> I am running ZCS OSE 8.7 on Ubuntu 14.04 in a single-node
>> configuration. My current backup/DR strategy is to perform these
>> steps nightly: * zmcontrol stop * rsync -avHKS --delete /opt/zimbra
>> backupserver:/opt/zimbra * zmcontrol start * mysqldump all tables
>> (just as a precaution) * zmslapcat (just as a precaution)
>>
>> This works pretty well, but it has a couple disadvantages: *
>> requires zimbra downtime every night * RPO of 24 hours
>>
>> It would be nice to have an OSE hot backup solution as well,
>> nothing as fancy as ZExtras Backup (which does per-account
>> restore), but just a basic DR solution. It seems like this would be
>> possible with a combination of the following: * rsync /opt/zimbra
>> to catch index, misc files, and store * zmslapcat to get the LDAP
>> database * Percona XtraBackup for consistent MySQL backups
>>
>> The challenge would be making sure that the database backup and 
>> /opt/zimbra/store were in sync.
>>
>> Has anyone developed a solution for OSE hot DR backups, or
>> something similar to what I've described?

Hmmm ... It's a very long time since I did any MySQL (back in the days
when MySQL 4.x was fresh and cool).  But does MySQL/MariaDB have some
"SQL" functions you can call before and after backup runs these days?

IIRC, PostgreSQL does have this, pg_start_backup() and pg_stop_backup().
 Very simply explained, the pg_start_backup() call ensures all data not
yet flushed to disk are written to disk and any SQL modifications done
before pg_stop_backup() are primarily held in memory.

If something similar would be available in MySQL/MariaDB, then it should
be fairly simple to get a safe file backup of the databases.

For LDAP, slapcat should be the proper way to dump the data in a safe
way.  And it usually is very quick too.

> We have done this well by using Snapshot. All you need is choose a
> file system that supports snapshot for your Zimbra partition /opt/zimbra.
> 
> Here we chose LVM snapshot. Please see a sample at:
> https://github.com/EmailConsortium/zimbra-lvm-backup
> 
> For DB + LDAP in sync with files, you should do DB + LDAP dumping
> before snapshot + rsync files. Your process should be changed to:
> * mysqldump all tables (just as a precaution)
> * zmslapcat (just as a precaution)
> * Start snapshot
> * rsync -avHKS --delete /opt/zimbra backupserver:/opt/zimbra

Wouldn't you mount the snapshot and rsync that snapshot?

> * End snapshot
> (no downtime needed)

Ideally, MySQL/MariaDB should be flushed and disk I/O "frozen" until the
snapshot generation have completed.  You have the mysqldump as a safe
guard though, but having clean database files is even easier to tackle.


-- 
kind regards,

David Sommerseth

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zetalliance.org/pipermail/users_lists.zetalliance.org/attachments/20160927/a1b27cbe/attachment.sig>


More information about the Users mailing list