If a production site encounters force majeure events such as a fire disaster or an earthquake or equipment failures such as software or hardware failures, applications may fail to run in a certain period. To ensure business continuity, Elastic Compute Service (ECS) disaster recovery provides cross-zone disaster recovery for you to back up application data and switch workloads to another zone to deal with failures in a single zone at the required recovery time objective (RTO) and recovery point objective (RPO).
A zone to deploy the disaster recovery system is selected. A virtual private cloud (VPC) is created in the zone. A VSwitch for replication and a VSwitch for restoration are created in the VPC.
Step 1: Create a disaster recovery site pair
To create a disaster recovery site pair that provides cross-zone disaster recovery protection for ECS instances in the primary site, perform the following steps:
- Log on to the Hybrid Backup Recovery (HBR) console.
- In the left-side navigation pane, choose .
- In the upper-right corner of the Disaster Recovery Center page, click + Add.
- In the Create Disaster Recovery Site Pair (Continuous Data Replication) pane, select Zone To Zone as Type and select the region and VPC for the primary and secondary sites.
- Click Create.
Step 2: Add the ECS instances to be protected
To add the ECS instances to be protected, perform the following steps:
- Click the Protected Server tab. In the upper-right corner of this tab, select the disaster recovery site pair that you created in Step 1 from the drop-down list.
- On the Protected Server tab, click + Add. In the Add Protected Server pane, select the ECS instances and click OK.
You must select 1 to 10 ECS instances.
In the Server Status column, verify that the status of the added ECS instances is Agent Installing and then changes to Initialized. If the status of an ECS instance is not Initialized, choosein the Operation column to initialize the instance.
Step 3: Start replication
To replicate ECS instances to the cloud and maintain real-time replication, follow these steps:
- On the Protected Server tab, find the ECS instance to be replicated and choose in the Operation column.
- In the Enable Replication pane that appears, set Recovery Point Policy, Use SSD, Replication Network, Recovery Network, and Automatic restart after replication interruption.
Note The VSwitches used for the replication and restoration networks must be in the same zone.
- Click Start.
Then, the ECS instance enters the Enable Replicating, Initial Full Sync, and Replicating states in sequence.
- Enable Replicating: ECS Disaster Recovery is scanning data on the ECS instance and evaluating the overall data volume. This process usually lasts a few minutes.
- Initial Full Sync: ECS Disaster Recovery is replicating valid data on the ECS instance to Alibaba Cloud. The replication duration depends on factors such as the volume of valid data on the instance and the network bandwidth. The progress bar in the Server Status column shows the replication progress.
- Replicating: After all valid data on the ECS instance is replicated to Alibaba Cloud through full replication, Aliyun Replication Service (AReS) monitors all write operations performed on disks on the ECS instance and continuously replicates incremental data to Alibaba Cloud in real time.
(Optional) Perform a disaster recovery drill
After an ECS instance enters the Replicating state, you can perform a disaster recovery drill on the ECS instance.
A disaster recovery drill is an important part of disaster recovery. It allows you to run a protected ECS instance on the cloud to verify the correctness of relevant applications. It has the following core features:
- Allows you to easily check whether a protected application can be run on the cloud.
- Helps you be familiar with the disaster recovery process and makes sure that you can smoothly perform failover when the primary site encounters a failure.
To perform a disaster recovery drill, follow these steps:
- On the Protected Server tab, find the target ECS instance and click Disaster Recovery Drill in the Operation column.
- In the Test Failover pane that appears, set Recovery Network, IP Address, Use ECS Specification, Hard Disk Type, Recovery Point, Elastic Public Network IP, and Execute script after failover.
- HBR automatically retains 24 recovery points in the last 24 hours for each ECS instance.
- If you do not select Use ECS Specification, you must specify the number of vCPUs and memory capacity.
- Click Start.
Then, Alibaba Cloud runs the ECS instance in the background at the specified time. The disaster recovery drill performed in the background does not affect real-time data replication.
- After the disaster recovery drill is completed within a few minutes, click the link in the Disaster Recovery Information column to verify restored data and applications.
- After the verification is completed, click Clear Test Failover Environment in the Operation column. Then, the restored ECS instance is deleted.
Note After the restored ECS instance is verified, we recommend that you delete the restored ECS instance as soon as possible to reduce costs.
Step 4: Perform failover
Regular disaster recovery drills make sure that you can run your business on the cloud at any time. When a major error occurs in the primary site, you may need to restart your core business on the cloud immediately. In this case, you must perform failover.
To perform failover, follow these steps:
- On the Protected Server tab, find the target ECS instance and choose in the Operation column.
- In the Failover pane that appears, set Recovery Network, IP Address, Use ECS Specification, Hard Disk Type, Recovery Point, Elastic Public Network IP, and Execute script after failover.
Notice You can restore the ECS instance to the current point in time only once.
- Click Start.
- After the failover is completed, click the link in the Recovered Instance ID/Name column to verify restored data and applications.
Note The procedure for changing the recovery point is similar to that for failover, except that you must select a recovery point earlier than the current point in time.
- If the applications run properly after being restored to the current point in time,
choose Note After you complete the failover or change the recovery point and verify that applications restored from the protected ECS instance are running your business, you can commit the failover to release the cloud resources occupied during failover to save resources.
in the Operation column.
- If the applications do not meet the requirements after being restored to the current point in time, for example, data in the restored database is inconsistent with that in the source database, or dirty data on the source ECS instance is synchronized to the restored ECS instance in the destination region, choose in the Operation column to change the recovery point before you commit the failover.
- If the applications run properly after being restored to the current point in time, choose
Step 5: Perform reverse replication
After you replicate applications on a protected ECS instance in Zone A to Zone B, you can also perform reverse replication to replicate applications from Zone B to Zone A.
To perform reverse replication, perform the following steps:
- On the Protected Server tab, find the target ECS instance and choose in the Operation column. In the message that appears, confirm that you want to perform reverse registration on the ECS instance.
- Choose Operation column. in the
- In the Initiate Reverse Replication pane that appears, set Original machine recovery, Replication Network, and Recovery Network.
Warning Cross-region disaster recovery and cross-zone disaster recovery allow you to replicate applications back to the original ECS instance. However, when you replicate applications back to the original ECS instance, data on the original ECS instance is overwritten. Perform this operation with caution.
- Click Start.
- After the ECS instance enters the Reversed Enable Replicating state, choose Operation column. in the
- In the Failback pane that appears, set CPU, Memory, Recovery Network, IP Address, and Execute script after recovery, and click Start.
- After the failback is completed, choose Operation column to register the protected ECS instance again. in the