Results 1 to 5 of 5

Thread: DR Best Practices In a Virtualized Environment?

  1. #1
    Join Date
    Sep 2006
    Location
    477 Congress Street | Portland, ME 04101
    Posts
    1,374
    Rep Power
    11

    Default DR Best Practices In a Virtualized Environment?

    We are a Zimbra Hosting Provider provider running a virtualised Zimbra farm on 7.2.1 presently; we also support multiple clients' virtualised Zimbra multi- and single-server environments. All of our storage is SAN-backed.

    We are looking to improve our DR methodologies in the event a Sandy/Irene/Katrina or similar event takes, or is expected to take, down the primary data center site, and a failover to the secondary data center at least several hundred miles away is made.

    Specifically, we are looking for a Zimbra-supported process which:
    1. is hypervisor agnostic (but which may rely on hypervisor-specific data transport tools).
    2. is data-safe (e.g. does not rely on rsyncing the entire /opt/zimbra tree without using LDIF to copy LDAP from the production to the DR site with Zimbra versions prior to 8).
    3. is, to the extent possible, Zimbra server-version agnostic.
    4. by leveraging intra-day transport of the redo logs, minimizes loss of data when failing over to the DR site.
    5. minimizes the time to "light up" a working DR site once a decision is made to failover.



    Background
    Historically our DR has relied on having cold standby Zimbra servers ready in the secondary data center; rsyncing the Zimbra NE backups from the primary to the secondary data center; running zmrestoreldap and zmrestoreoffline followed by making changes to public DNS to complete the failover. As the store sizes grow, this process consumes a great deal of inter-data center bandwidth (to rsync the backups) and increases the time to complete the failover as zmrestoreoffline takes a fair amount of time to do its work.

    The Admin Guide points out (NE 7.2, April 2012 edition, page 239) that storage layer snapshots, in conjunction with zmplayredo, may be used as an alternative to Zimbra's own backup and restore feature by leveraging Zimbra's redo logs. But the Admin Guide does not lay out the entire redolog DR process to the extent it does for a Zimbra server replacement.

    Consequently, we are starting this thread to try to document this redo log-based DR process. Once done, I'm happy to write a wiki article and suggest Zimbra mark it as Certified Documentation once they have QA'd it. We are seeing hardly any new Zimbra installs going on bare metal, so upgrading the documented DR processes to take advantage of hypervisor-related technologies seems timely. Please help!


    Proposed High-Level DR Process
    Reading between the lines of the above-mentioned Admin Guide process, we are contemplating testing the following process, and would be grateful for feedback from the community before we get too far ahead of ourselves here. At a high level, the process it seems to us would comprise:


    One-Time or Infrequent Initialization Tasks
    1. Shorten the TTLs for all Zimbra server public DNS records, and/or use a third-party DNS provider who can orchestrate rapid DNS failover-based changes.
    2. On the production Zimbra servers, as root do a "chkconfig zimbra off", then as the zimbra user do a zmcontrol stop, shut down the virtual machine, note the exact time, take a hypervisor-level snapshot of the Zimbra virtual machines and then restart the virtual machines and Zimbra, and then as root run "chkconfig zimbra on".
    3. Depending on the hypervisor, use appropriate procedures to create clones of the Zimbra servers from the snapshots and transfer them to the DR data center.
    4. (As and when production Zimbra is upgraded/patched, steps 2. and 3. here will need to be repeated).
    5. At the DR site, boot the cloned Zimbra mailbox servers only (Zimbra itself will not start and should not be started)


    Routine Syncing Between The Production and DR Servers
    1. Schedule a cron job which, after each zmbackup on the production servers, rsyncs from /opt/zimbra/backup on the production servers to the DR servers just /opt/zimbra/backup/ldap and /opt/zimbra/backup/sys (for full backups) and /opt/zimbra/backup/ldap, /opt/zimbra/backup/sys and /opt/zimbra/backup/redologs (for incremental backups).
    2. After the above rsync is complete, run zmrestoreldap daily and zmplayredo --logfile=/opt/zimbra/backup/sessions/incr-[sessionID] after the incremental backup rsyncs only.
    3. In zimbra's crontab at the DR site, comment out the lines which run full and incremental zmbackup, but keep the line which prunes older backups.
    4. Schedule a cron job which every hour or so, rsyncs /opt/zimbra/redolog with the --delete switch from the production Zimbra mailbox servers to the DR site Zimbra mailbox servers.


    Failover to DR Site Process

    1. On the DR Zimbra mailbox servers, run zmplayredo --logfile=/opt/zimbra/redolog one last time, then start Zimbra on all DR servers.
    2. If the production site is still reachable, shutdown the Zimbra servers.
    3. Update public DNS to point to the DR Zimbra servers.


    Questions and Missing Bits
    1. Is it true that, once a Zimbra server is snapshotted as above and transported to the DR site, keeping this DR Zimbra server periodically in sync with the production site requires only restoring a recent version of LDAP and replaying the redo logs? Is there any other data which needs to copied over to avoid having to ship the entire /opt/zimbra/backup tree between the production and DR sites?
    2. Is anyone using this technique (or a variation thereof) presently, and have you ever tested, or actually had to, fail over to the DR site?
    3. What else needs to be included from a process standpoint that we haven't thought of?


    Thanks!
    Mark

  2. #2
    Join Date
    May 2007
    Location
    Zimbra
    Posts
    1,285
    Rep Power
    10

    Default

    Hi Mark,

    On the LDAP DR portion, what we did at my previous job, and would work well with Zimbra too, is to simply configure off-site replicas. That way, in the case of something like Katrina, we had an active backup of all the user data. This was for a university, so it included helpful bits like the students home contact information, etc.

    If you did this with ZCS, I would recommend having an offsite server that is LDAP only, and configuring it either as a replica, or (with ZCS 8), as a backup master as part of an MMR configuration. You noted you wanted to be ZCS version agnostic with relation to the LDAP server. The only issue there is that the Zimbra schema can, and does, change between versions, even minor versions like 7.2.x to 7.2.y. So for things to remain usable, it is best to keep the ZCS versions in sync. On the plus side, upgrading an ldap only server is quick and fairly painless.

    If you go the replica-only route, and there is a disaster, it is fairly simple to later promote the replica to be a master: https://wiki.zimbra.com/wiki/Promoti...to_LDAP_Master

    --Quanah
    Quanah Gibson-Mount
    Server Architect
    Zimbra, Inc
    --------------------
    Zimbra :: the leader in open source messaging and collaboration

  3. #3
    Join Date
    May 2007
    Location
    Zimbra
    Posts
    1,285
    Rep Power
    10

    Default

    Two other thoughts.

    a) rsync -- You can do this safely on ZCS 7 and prior if you stop the ldap server, and then run db_recover on all the databases (The master has two). This will write out all pending changes. Live rsync, or rsync where db_recover has not been run, continues to be unsafe. On ZCS 8 and later, ldap simply needs to be stopped when running rsync (with -S)

    b) I'm guessing you have a fairly large database, since you seem to want to avoid slapcat/slapadd (the official method of backing up ldap). I would note that in ZCS8, write performance for the LDAP server is more than 2 times greater than it is in ZCS7 and prior. This significantly decreases the amount of time it takes to slapadd a database. For example, with a 6 million entry database from a customer that I use for testing, slapadd time went from 140 minutes to 45 minutes.
    Quanah Gibson-Mount
    Server Architect
    Zimbra, Inc
    --------------------
    Zimbra :: the leader in open source messaging and collaboration

  4. #4
    Join Date
    Dec 2006
    Location
    Minneapolis MN
    Posts
    777
    Rep Power
    9

    Default

    Mark,

    Quote Originally Posted by LMStone View Post
    Questions and Missing Bits
    1. Is it true that, once a Zimbra server is snapshotted as above and transported to the DR site, keeping this DR Zimbra server periodically in sync with the production site requires only restoring a recent version of LDAP and replaying the redo logs? Is there any other data which needs to copied over to avoid having to ship the entire /opt/zimbra/backup tree between the production and DR sites?
    2. Is anyone using this technique (or a variation thereof) presently, and have you ever tested, or actually had to, fail over to the DR site?
    3. What else needs to be included from a process standpoint that we haven't thought of?


    Thanks!
    Mark
    I am doing the same type of thing with Amazon AWS. /opt/zimbra gets snapshot'ed less often (every 4 hours), and I have mounts for LDAP and redologs that get snapshot much more often (every 2 minutes). Since I am running Zimbra on Amazon EC2, the snapshots are using Amazon's EBS service and are very fast. I am also using the ec2-consistent-snapshot script which forces a flush of the MySQL (mailbox) databases, and then freezes the file system. The whole process takes less than 1 second and there are no user interruptions in the process.

    I haven't actually had to do a real DR, but I have tested and was quickly able to restore the server and reply the last 4 hours of redo logs, and did not see any issues. It puts my RPO (Recovery Point Objective) at 2 minutes, which IMO, is a great target.

    In addition, I also used this to restore a deleted account, as I was able to restore the snapshot to a temporary location, play the redo logs up to a certain period of time, and then use zmmailbox with getRestURL/postRestURL to get the old account data and restore it into the production server.

    Long story short, I've been doing just that since July 2nd without any issues. Offline testing showed success (restore and verify most recent mail and accounts were available in a test offline system that wasn't put into production), as well as restoring content from an account.
    01 Networks, LLC / Cybernetik.net
    Zimbra NE and OSS Cloud Hosting
    Shared Web Hosting
    Consulting Services

  5. #5
    Join Date
    Jun 2007
    Location
    Michigan
    Posts
    13
    Rep Power
    8

    Default

    Mark,

    We have attacked this problem at the hypervisor level (in our case VMWare) with Veeam Backup and Replication. We use Veeam to replicate Zimbra VM to our DR site, in case of disaster or issue we simply failover to our Zimbra server copy at our DR site. This allows us great flexibility and depending on one's data loss tolerance is flexible in terms of the amount of restore points per hour,day,week,month,etc.

    Also based on the Zimbra/VMWare relationship and what I have read of their change from RedHat cluster services being not supported and instead encouraging native VMWare abilities to provide HA/FT would seem to be inline with that direction as well.

    Also in terms of process, reverting to a DR replica is much quicker/simpler than some of the process you have discussed which sounds semi-manual and prone to issues/errors.

    Veeam also provides us the ability to schedule testing of these VM replicas to ensure data integrity, which so far we have had no issues with.

    Just our $0.02 from what we are doing, Veeam introduces a lot of flexibility but large quantities of raw storage or dedup. is needed as well as large bandwidth capacity for replication.
    Travis Kensil
    Network Administrator
    NTB Inc.

    Running Zimbra 7.2.3 on Red Hat 5 (64bit)

Similar Threads

  1. Replies: 1
    Last Post: 07-07-2012, 05:05 AM
  2. Best Practices?
    By bmarshallbri in forum Administrators
    Replies: 4
    Last Post: 01-23-2008, 03:47 PM
  3. Looking for Best Practices
    By peter@mxtoolbox.com in forum Zimbra Connector for Outlook
    Replies: 0
    Last Post: 12-05-2007, 02:57 PM
  4. Best Practices Question
    By msf004 in forum Administrators
    Replies: 2
    Last Post: 09-06-2007, 02:40 PM
  5. Best practices?
    By Nutz in forum Installation
    Replies: 4
    Last Post: 02-08-2007, 05:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •