All Products
Search
Document Center

Elastic Compute Service:Use the async replication feature to implement disaster recovery

Last Updated:Mar 25, 2024

After you create and activate a replication pair, you can use the async replication feature to implement disaster recovery if the primary disk fails. This topic describes how to use the async replication feature to implement disaster recovery.

Prerequisites

Before you use the reverse replication sub-feature to perform a reverse replication, make sure that the primary disk has been detached from its associated Elastic Compute Service (ECS) instance and is in the Unattached state. For more information, see Detach a data disk.

Background Information

When you use the async replication feature to implement disaster recovery, take note of the following items:

  • The async replication feature includes the failover and reverse replication sub-features. If the primary disk in a replication pair fails, you can use the failover sub-feature to enable read and write permissions on the secondary disk, attach the secondary disk to a temporary ECS instance, and then fail over to the disk. After the primary disk recovers, you can use the reverse replication sub-feature to reverse the replication relationship and replicate the latest data from the secondary disk to the primary disk for disaster recovery.

  • If a replication pair is added to a replication pair-consistent group, a failover or reverse replication cannot be separately performed on the replication pair. In this case, you can only batch manage all replication pairs within the replication pair-consistent group together. For more information, see Use replication pair-consistent groups to implement disaster recovery.

Step 1: (Optional) Perform a failover drill

After the async replication feature is enabled, data is replicated from the primary disk to the secondary disk based on replication pairs. You can use the failover drill feature to ensure continuous replication and replicate the data at the latest recovery point from a secondary disk to a new disk. This helps test the completeness and correctness of applications at the secondary site. During a failover drill, real-time data replication is not affected. If a primary site encounters faults, the failover drill continues. If a secondary site encounters faults, the failover drill fails.

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

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

  3. In the top navigation bar, select the required region. Example: China (Beijing).

  4. Find the replication pair for which you want to perform a failover drill and click the ID of the replication pair.

  5. In the Walkthrough section, click Create walkthroughs.

  6. In the Create walkthroughs message, confirm the region, zone, type, and size of the drill disk, and click OK.

    After you create the failover drill, a pay-as-you-go disk of the same type and size as the secondary disk is created in the zone where the secondary disk is located. The new disk contains data at the latest recovery point.

    Note

    After you create the failover drill, you can perform the following operations based on your business requirements:

    • Create more failover drills to back up data at different recovery points.

    • Delete multiple drill pairs and drill disks with a few clicks in the Walkthrough section.

Step 2: Perform a failover

The failover sub-feature allows you to enable read and write permissions on a secondary disk and perform a failover to the disk. We recommend that you create a temporary ECS instance in advance within the region and zone where the secondary disk is located. This way, if the primary disk fails, you can use the failover sub-feature to enable read and write permissions on the secondary disk, attach the secondary disk to the temporary ECS instance, and then fail over to the secondary disk. You can continue your business on the secondary disk until the primary disk recovers. For more information about how to create an ECS instance, see Creation methods.

Warning

The failover sub-feature suspends the async replication feature. Use this sub-feature only if your primary disk fails to prevent data loss.

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

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

  3. In the top navigation bar, select the required region. Example: China (Beijing).

    When you use failover and reverse replication to implement disaster recovery for a primary disk, you must switch to the region where the secondary disk is located.

  4. Find the replication pair to which the faulty primary disk belongs and choose image.png > Perform Failover in the Actions column.

  5. In the message that appears, read the notes and click OK.

    After failover is enabled, the status of the replication pair changes to Failovered. In this case, you can attach the secondary disk to a temporary ECS instance and fail over to the disk.

Step 3: Perform a reverse replication

After the primary disk recovers, you can use the reverse replication sub-feature to replicate the latest data from the secondary disk to the primary disk for disaster recovery.

  1. In the top navigation bar, select the required region. Example: China (Beijing).

    When you use failover and reverse replication to implement disaster recovery for a primary disk, you must switch to the region where the secondary disk is located.

  2. Find the replication pair on which you performed a failover and choose image.png > Perform Reverse Replication in the Actions column.

  3. In the Reprotect dialog box, read the notes and click Create Snapshot to create a snapshot for the primary disk.

    Warning

    In reverse replication, the original data on the primary disk is overwritten by the data replicated from the secondary disk. We recommend that you create snapshots for the primary disk to back up disk data and prevent data loss. If you manually created a snapshot for the primary disk after the disk recovers, you do not need to create a snapshot for the disk in the dialog box. You are charged for snapshots. For more information, see Snapshots.

  4. After a snapshot is created for the primary disk, click OK.

    The status of the replication pair changes to Stopped.

    Important

    After the reverse replication sub-feature is used, the replication relationship is reversed. The original primary disk is automatically switched to the secondary disk and the original secondary disk is switched to the primary disk. For example, before a reverse replication is performed, Enhanced SSD (ESSD) A in the China (Beijing) region is the primary disk and ESSD B in the China (Shanghai) region is the secondary disk. After a reverse replication is performed, the replication relationship is reversed and ESSD B is switched to the primary disk and ESSD A is switched to the secondary disk.

  5. Find the required replication pair and click Activate in the Actions.

    In this step, activate the replication pair to asynchronously replicate data from the original secondary disk to the original primary disk.

    After data is asynchronously replicated from the original secondary disk to the original primary disk, the status of the replication pair changes to Normal and disaster recovery is implemented.

  6. Optional. Revert the relationship between the disks in the replication pair.

    After you perform the preceding steps to perform a reverse replication, the original relationship in the replication pair is reversed. If you want to revert the relationship, perform the following steps:

    1. Find the required replication pair, view the region in the Secondary Disk/Region/Zone column, and then select the region in the top navigation bar to switch to the region.

      For example, if China (Beijing) is displayed in the Secondary Disk/Region/Zone column, select China (Beijing) in the top navigation bar. For more information about regions, see Regions and zones.

    2. Find the replication pair on which you performed a reverse replication and choose image.png > Perform Failover in the Actions column.

    3. Choose image.png > Perform Reverse Replication in the Actions column.

    4. After the relationship in the replication pair is reverted, click Activate in the Actions column to reactivate the replication pair.