Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 51

Thread: How to: cold standby server (no cluster)

  1. #41
    Join Date
    Jun 2010
    Posts
    21
    Rep Power
    5

    Default

    I am working on my script now: almost done. One interesting thing i found as that i found zimbra some time crated both full-201105... and incr-201105... folder in backup/sessions folder although it was not supposed to full backup that day. Do anybody know why? I need to figure it out since i need to know which folder for restore ldap and for redolog replay.

    Thanks,
    Rocky

  2. #42
    Join Date
    May 2008
    Posts
    432
    Rep Power
    7

    Default

    There's lots of info here in the forums. It is the first backup for new accounts. New accounts get a full backup on the day of creation. After that, incrementals.

  3. #43
    Join Date
    Jun 2010
    Posts
    21
    Rep Power
    5

    Default

    Quote Originally Posted by iway View Post
    There's lots of info here in the forums. It is the first backup for new accounts. New accounts get a full backup on the day of creation. After that, incrementals.
    You did not get my point, i am wondering which folder (incr or full ) i need to restore for ldap and mailbox. I checked only "incr-date-..." has "redologs" subfolder, i'll use this one for my daily redo log play script.

  4. #44
    Join Date
    May 2008
    Posts
    432
    Rep Power
    7

    Default

    Redologs are in the incr folder, ldap backups should be in both.

  5. #45
    Join Date
    Jun 2010
    Posts
    21
    Rep Power
    5

    Default

    Thanks.

    I finished all my script and tested my daily cold restore script, works very smooth. I'll post my code here ( use it at your own risks ):

    1. All the functions/scripts are running from cronjob:

    Code:
    # Hourly sync redo log from live to standby
    0 * * * * /usr/bin/rsync -avr --delete zimbra-primary.mydomain.com:/opt/zimbra/redolog/ /BACKUP/live_redo_log/ 2>1 >>/var/log/zimbra_sync.log
    # Daily (Mon-Fri) sync backup and replay redo log
    30 1 * * 1-5 /root/daily_sync_live_server.sh 2>1 >>/var/log/zimbra_sync.log
    # Daily (Sun) sync backup and replay redo log, it get delayed because we need to wait rsync and restoreation done before apply redo log
    0 12 * * 0 /root/daily_sync_live_server.sh 2>1 >>/var/log/zimbra_sync.log
    # Weekly(Sat) sync backup and restore Zimbra whole DB and Mailbox
    30 10 * * 6 /root/weekly_sync_live_server.sh 2>1 >>/var/log/zimbra_sync.log
    2. weekly_sync_live_server.sh ( in /root directory):

    Code:
    #!/bin/bash
    
    echo "`date`: start weekly syncing backups"
    /usr/bin/rsync -avr --delete root@zimbra-primary.mydomain.com:/zimbabackup/ /zmailbackup/
    echo "`date`: start restoring backups"
    su - zimbra /opt/zimbra/weekly_cold_restore.sh
    echo "`date`: restore finished"
    And it called /opt/zimbra/weekly_cold_restore.sh:

    Code:
    #!/bin/bash
    zmcontrol stop
    rm -rf /opt/zimbra/db/data/*
    /opt/zimbra/libexec/zmmyinit
    LABEL=`zmrestoreldap -lbs -t /zimbrabackup | sed -n 1p`
    zmrestoreldap -t  /zimbrabackup  -lb $LABEL
    zmconvertctl start
    zmlocalconfig -f -e zimbra_ldap_password=YOUR_EXIST_LDAP_PASS_ON_LIVE_SERVER
    zmmailboxdctl start
    zmmailboxdctl stop
    cd /tmp; nohup zmrestoreoffline -t /zimbrabackup/ -lb $LABEL -sys -a all -c -br &
    The above is just a series commands copied from Network Edition Disaster Recovery - Zimbra :: Wiki ; Note there missed some return results check script, it is just a very simple one. Hope someone else can found more robust auto restoration script. I ran it once, worked for me.

    3. daily_sync_live_server.sh ( in /root directory):

    Code:
    #!/bin/bash
    
    echo "`date`: start weekly syncing backups"
    /usr/bin/rsync -avr --delete root@zimbra-primary.mydomain.com:/zimbabackup/ /zmailbackup/
    echo "`date`: start restoring backups"
    su - zimbra /opt/zimbra/daily_cold_restore.sh
    echo "`date`: restore finished"

    And here is /opt/zimbra/daily_cold_restore.sh: (play redo log):

    Code:
    #!/bin/bash
    LABEL=`zmrestoreldap -lbs -t /zimbrabackup | grep incr | sed -n 1p`
    zmrestoreldap -lb $LABEL -t /zimbrabackup
    for i in `ls -rt /zimbrabackup/sessions/$LABEL/redologs/`
    do
            echo "Processing /zimbrabackup/sessions/$LABEL/redologs/$i..."
            zmplayredo --logfiles /zimbrabackup/sessions/$LABEL/redologs/$i
    done
    4. In case live server failure, run this script to apply latest redo log then make it live:

    /opt/zimbra/replay_redolog_live.sh:

    Code:
    #!/bin/bash
    for i in `ls -rt /BACKUP/live_redo_log/archive/`
    do
            echo "Processing /BACKUP/live_redo_log/archive/$i..."
            zmplayredo --logfiles /BACKUP/live_redo_log/archive/$i
    done
    zmplayredo --logfiles /BACKUP/live_redo_log/redo.log
    zmcontrol stop
    zmctrol start
    Hope it can help some one else which has the similar situation as me. Our current server configuration:

    Live server and standby server: Zimbra NE 7.0.1 on CentOS 5.5
    Default backup schedule enabled on live server: weekly full backup, daily incremental, keep last 30 days data
    Zimbra user accounts: 100~150
    Mailstorage size: 200GB~300GB

    For us, the rsync one full backup took 18~24 hours, restoration from one full backup took 4 hours; Replaying one day'd redo log took 10~20 minutes.

  6. #46
    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    4

    Default How to: cold standby server (no cluster)

    Hi,
    I've read through this post and just curious to see if anyone is installing a local dns server on the cold standby server. i have inherited the zimbra setup from past admin and the cold-standby server is not starting up. i don't see any dns server on the cold-standy server. should i install the dnsmasq to trick the cold-standby?

    thanks

  7. #47
    Join Date
    Jun 2008
    Location
    Berkeley, CA
    Posts
    1,474
    Rep Power
    9

    Default

    I would use dnsmasq. Very simple to configure so that it just does what you need it to do; it's what I use on my cold standby.

  8. #48
    Join Date
    Jul 2011
    Location
    New York
    Posts
    1
    Rep Power
    4

    Default

    How can use dnsmasq? Will you leave the answer to me..

  9. #49
    Join Date
    Jun 2008
    Location
    Berkeley, CA
    Posts
    1,474
    Rep Power
    9

    Default

    http://www.thekelleys.org.uk/dnsmasq/doc.html

    IIRC, it's included in RHEL; you just have to activate it as a service.

  10. #50
    Join Date
    Sep 2011
    Posts
    15
    Rep Power
    4

    Default

    Found a good idea using dnsmasq...

Similar Threads

  1. initializing ldap...FAILED(256)ERROR
    By manjunath in forum Installation
    Replies: 39
    Last Post: 06-07-2013, 10:27 AM
  2. Zimbra fails after working for 2 weeks
    By Linsys in forum Administrators
    Replies: 10
    Last Post: 10-07-2008, 12:42 AM
  3. need advice on configuring zimbra to work with fax server
    By pheonix1t in forum Administrators
    Replies: 0
    Last Post: 07-11-2007, 07:46 PM
  4. Error 256 on Installation
    By RuinExplorer in forum Installation
    Replies: 5
    Last Post: 10-19-2006, 09:19 AM
  5. Getting problems in FC4 while instalation
    By kitty_bhoo in forum Installation
    Replies: 13
    Last Post: 09-12-2006, 10:34 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
  •