You are here: Administration > Avoiding Full Resynchronizations

Avoiding Full Resynchronizations

When replicating large amounts of data over a WAN link, it is desirable to avoid full resynchronizations which can consume large amounts of network bandwidth and time. With newer kernels, SteelEye DataKeeper can avoid almost all full resyncs by using its bitmap technology. However, the initial full resync, which occurs when the mirror is first set up, cannot be avoided when existing data is being replicated. (For brand new data, SteelEye does not perform a full resync, so the steps below are not necessary.)

There are a couple of ways to avoid an initial full resync when replicating existing data. Two recommended methods are described below.

Method 1

The first method consists of taking a raw disk image and shipping it to the target site. This results in minimal downtime as the mirror can be active on the source system while the data is in transit to the target system.

Procedure

  1. Create the mirror (selecting Replicate Existing Filesystem), but do not extend the mirror to the target system.

  2. Take the mirror out of service.

  3. Take an image of the source disk or partition. For this example, the chosen disk or partition is /dev/sda1:

root@source# dd if=/dev/sda1 of=/tmp/sdr_disk.img bs=65536

(The block size argument of 65536 is merely for efficiency).

This will create a file containing the raw disk image of the disk or partition.

Note that instead of a file, a hard drive or other storage device could have been

used.

  1. Optional Step – Take a checksum of the source disk or partition:

root@source# md5sum /dev/sda1

  1. Optional Step – Compress the disk image file:

root@source# gzip /tmp/sdr_disk.img

  1. Clear the bitmap file, e.g.:

root@source# /opt/LifeKeeper/bin/bitmap -c /opt/LifeKeeper/bitmap_sdr

  1. Bring the mirror and dependent filesystem and applications (if any), into service. The bitmap file will track any changes made while the data is transferred to the target system.

  2. Transfer the disk image to the target system using your preferred transfer method.

  3. Optional Step – Uncompress the disk image file on the target system:

root@target# gunzip /tmp/sdr_disk.img.gz

  1. Optional Step – Verify that the checksum of the image file matches the original checksum taken in Step 4:

root@target# md5sum /tmp/sdr_disk.img

  1. Transfer the image to the target disk, for example, /dev/sda2:

root@target# dd if=/tmp/sdr_disk.img of=/dev/sda2 bs=65536

  1. Set LKDR_NOFULL_SYNC=1 in /etc/default/LifeKeeper on both systems:

root@source# echo 'LKDR_NO_FULL_SYNC=1' >>

/etc/default/LifeKeeper

root@target# echo 'LKDR_NO_FULL_SYNC=1' >> /etc/default/LifeKeeper

  1. Extend the mirror to the target. A partial resync will occur.

Method 2

This method can be used if the target system can be easily transported to or will already be at the source site when the systems are configured. This method consists of temporarily modifying network routes to make the eventual WAN mirror into a LAN mirror so that the initial full resync can be performed over a faster local network. In the following example, assume the source site is on subnet 10.10.10.0/24 and the target site is on subnet 10.10.20.0/24. By temporarily setting up static routes on the source and target systems, the "WAN" traffic can be made to go directly from one server to another over a local ethernet connection or loopback cable.

Procedure

  1. Install and configure the systems at the source site.

  2. Add static routes: 

root@source# route add -net 10.10.20.0/24 dev eth0

root@target# route add -net 10.10.10.0/24 dev eth0

The systems should now be able to talk to each other over the LAN.

  1. Configure the communication paths in LifeKeeper.

  2. Create the mirror and extend to the target. A full resync will occur.

  3. Pause the mirror. Changes will be tracked in the bitmap file until the mirror is resumed.

  4. Delete the static routes:

root@source# route del -net 10.10.20.0/24

root@target# route del -net 10.10.10.0/24

  1. Shut down the target system and ship it to its permanent location.

  2. Boot the target system and ensure network connectivity with the source.

  3. Resume the mirror. A partial resync will occur.

© 2012 SIOS Technology Corp., the industry's leading provider of business continuity solutions, data replication for continuous data protection.