Implement disaster recovery with replication pair-consistent groups

更新时间:
复制 MD 格式

After you create and start a replication pair-consistent group, if disks at the production site fail, you can initiate a failover. This action grants read and write permissions to the secondary site disks, allowing you to attach them to temporary ECS instances and resume services. After the failed disks at the production site are repaired, you can perform a reverse replication to copy the latest data from the secondary site back to the production site. This process restores operations at the production site. This topic describes how to use a replication pair-consistent group to perform disaster recovery for multiple disks.

Note

When you perform a failover or reverse replication for a replication pair-consistent group, the operation applies to all disk replication pairs within the group simultaneously.

Prerequisites

  • Before performing a reverse replication, ensure that the primary disk is in the Unattached state or that the ECS instance to which it is attached is Stopped. For more information, see Detach a data disk.

    Note

    Reverse replication copies data from the secondary disk to the primary disk. The primary disk must be in a read-only state during this process; otherwise, the replication fails.

  • (Recommended) Create a snapshot for the disk to back up its data. For more information, see Create a snapshot.

    Note

    Creating a snapshot incurs charges. For more information, see Snapshot billing.

(Optional) Step 1: Disaster recovery drill

After asynchronous replication is started, the replication pair-consistent group continuously replicates data from the primary disks at the production site to the secondary disks at the secondary site. The disaster recovery drill feature lets you clone a secondary disk to a new disk, known as a drill disk, to verify the integrity and correctness of applications at the secondary site. During a disaster recovery drill, the drill does not affect asynchronous replication. A failure at the production site does not affect the drill, but a failure at the secondary site causes the drill to fail.

  1. Log on to the Elastic Block Storage (EBS) console.

  2. In the left-side navigation pane, choose Enterprise-level Features > Replication Pair-consistent Group.

  3. In the top navigation bar, select the region and resource group of the resource that you want to manage. Region

  4. Find the replication pair-consistent group for which you want to perform a disaster recovery drill and click its ID.

  5. In the Drills section, click Create Drill.

  6. In the Create Drill dialog box, confirm the region and zone of the replication pair, and then click OK.

    After the drill is created, disks with the same number and configurations as the replication pairs are created in the secondary zone. These disks hold data from the most recent recovery point and are used to verify the integrity and correctness of your applications.

    Note
    • You can create multiple disaster recovery drills as needed to back up data from different recovery points.

    • After you complete the verification, we recommend that you delete the drill relationship and the drill disks in the Drills section to reduce costs.

Step 2: Failover

Warning

The failover feature pauses asynchronous replication. To prevent data loss, perform a failover only if the production site fails.

  1. In the top navigation bar, switch to the region of the secondary site, such as China (Beijing).

  2. In the list of replication pair-consistent groups, find the group that belongs to the failed production site. In the Actions column, choose image.png > Failover.

    Note

    Alternatively, you can click the group ID. On the details page of the group, click Failover in the upper-right corner to perform a batch failover.

  3. Read the on-screen instructions and click OK.

    After the failover is complete, the status of the replication pair-consistent group changes to Failed Over.

  4. Attach the disks at the secondary site to a newly created ECS instance to resume business operations.

    For more information, see Create an instance by using the wizard and Attach a data disk.

Step 3: Reverse replication

Warning

Reverse replication overwrites data on the production site disks with data from the secondary site disks. To prevent the loss of historical data, we recommend that you create snapshots for the disks at the production site. For more information, see Create a snapshot.

  1. In the top navigation bar, switch to the region of the secondary site, such as China (Beijing).

  2. In the list of replication pair-consistent groups, find the group for which the failover is complete. In the Actions column, choose image.png > Reverse Replication.

    Note

    Alternatively, you can click the group ID. On the details page of the group, click Reverse Replication in the upper-right corner to perform a batch reverse replication.

  3. In the Reverse Replication dialog box, read the on-screen instructions and click OK.

    The status of the replication pair-consistent group changes to Stopped, and the roles of the production and secondary sites are reversed.

    Note

    A reversed relationship means that the original production site becomes the new secondary site, and the original secondary site becomes the new production site. For example:

    • Before reverse replication, the production site is in the China (Shanghai) region and the secondary site is in the China (Beijing) region.

    • After reverse replication, the production site is in the China (Beijing) region and the secondary site is in the China (Shanghai) region.

  4. In the Actions column of the replication pair-consistent group for which reverse replication is complete, click Start.

    This step starts asynchronous replication to copy data from the disks at the new production site (the original secondary site) to the disks at the new secondary site (the original production site).

    When the status of the replication pair-consistent group changes to Normal, data from the original secondary site disks has been replicated to the original production site disks, and the disaster recovery is complete.

  5. (Optional) Restore the initial relationship between the production and secondary sites.

    During the reverse replication, the roles of the production and secondary sites were reversed. If your business environment requires the original site relationship to be restored, perform the following steps:

    1. Check the region in the Secondary Region/Zone column for the replication pair-consistent group. In the top navigation bar, switch to that region.

    2. Find the group for which reverse replication is complete. In the Actions column, choose image.png > Failover.

    3. In the Actions column, choose image.png > Reverse Replication.

    4. After the original site relationship is restored, click Start in the Actions column to re-enable the replication pair-consistent group.

    5. In the list of replication pair-consistent groups, check the Primary Region/Zone and Secondary Region/Zone columns to verify that the site relationship is restored.