Disaster recovery test

Updated at:

This topic describes how to use the disaster recovery management service in Cloud Architect Design Tools (CADT) to perform failover and failback operations for an application during a disaster recovery test, and covers important considerations.

Prerequisites

Deploy an application

For demonstration purposes, this topic uses a deployed CADT application with the architecture diagram shown below.导出架构图

Create a disaster recovery plan

  1. Log on to the Cloud Architect Design Tools (CADT) console and navigate to the disaster recovery management service page.

  2. First, create a disaster recovery plan. Click Create Disaster Recovery Plan, select the application to add to the plan from the drop-down list, and then click OK.

    Note

    You can create a disaster recovery plan only for a CADT application that is in the Deployment Succeeded state.

  3. After the disaster recovery plan is created, its details page is displayed.

  4. On the disaster recovery plan page, click View Architecture Diagram to go to the CADT console and view the application's architecture diagram.image

  5. A disaster recovery test requires a disaster recovery set, so you must create one first.

Create a disaster recovery set

  1. On the disaster recovery plan page, click Create Disaster Recovery Set.

  2. In the Create Disaster Recovery Set dialog box, configure the following items and click OK.

    Parameter

    Description

    Disaster recovery set name

    Specify a name for the disaster recovery set.

    Note

    The name must be 2 to 128 characters in length. It must start with an uppercase or lowercase letter or a Chinese character, and can contain digits, periods (.), underscores (_), colons (:), and hyphens (-).

    Resource type

    Select the resource types to include in the disaster recovery set.

    The available resource types are determined by the resources contained in the disaster recovery plan.

    Primary node

    Specify the primary node for the resource during the disaster recovery test.

    Secondary node

    Specify the secondary node for the resource during the disaster recovery test.

    Note

    You do not need to select a secondary node for multi-node instance types, such as ApsaraDB RDS for MySQL High-availability, Cluster, or three-node Enterprise Edition instances.

  3. Following the table, this example creates a disaster recovery set named S1, where one ECS instance (ecs-01) from the CADT application is set as the primary node and another ECS instance (ecs-02) as the secondary node. Complete the configuration for each tab in order, and then click OK.

  4. After the disaster recovery set is created, you can expand its drop-down list to view details. A status of Validation Succeeded confirms that the primary and secondary nodes and their respective zones are configured correctly.

  5. To configure additional resources in the disaster recovery set, find set S1 in the list and click Configure in the Actions column.

    For example, to add an ApsaraDB RDS for MySQL instance to set S1, open the Create Disaster Recovery Set dialog box, enter the Disaster Recovery Set Name (for example, S1), select rds as the Resource Type, choose the target RDS instance (for example, RDS_MySQL - rm-2zedk3m73k3qjs2py) as the primary node, and select its corresponding standby instance as the secondary node. Then, click OK. After the disaster recovery set is updated, expand it to view the resource list. The ecs and rds resources now show a status of Validation Succeeded, indicating they are configured correctly. The Actions column provides options such as Prepare for Switchover, View Preparation Results, Switch Over Disaster Recovery Set, Configure, and Delete.

  6. After creating the disaster recovery set, you can set the switchover order for its resources. If you set the order for the ApsaraDB RDS for MySQL instance to 2, the ECS instance will be switched over first. Only after the ECS switchover succeeds will the ApsaraDB RDS for MySQL instance be switched over. In the resource list for disaster recovery set S1, the Order column shows the switchover sequence: the ecs resource has an order of 1 and the rds resource has an order of 2. Their statuses are both Validation Succeeded.

Failover test

  1. After the disaster recovery set is configured, you can start the failover test. Before you begin, view the resources to record their Resource Status and the primary and secondary zone distribution. This helps you compare the results after the failover. Before the failover, the initial state of the application's associated resources is as follows: ecs-02 (in zone cn-beijing-h) and ecs-01 (in zone cn-beijing-k) are both Running. The RDS_MySQL instance has its primary zone in cn-beijing-k and secondary zone in cn-beijing-h, and its status is Running.

  2. Click Switch Over Disaster Recovery Set. Read the prompt carefully and confirm your choice to start the failover.

    A dialog box appears with the following message: After the switchover, all ECS instances in the disaster recovery set will be forcibly shut down, and other cloud products will be forcibly switched to their standby zones. This may cause unpredictable system exceptions and data loss. Confirm that you have backed up data for your ECS instances and databases, and that you are prepared for a service interruption of four hours or more. Click I understand the consequences and confirm the switchover to proceed.

  3. The failover process begins with the ECS instance, according to the specified order. In the resource list, the ECS instance status changes to Switching Over, while the RDS instance status remains Validation Succeeded.

  4. After the ECS instance failover is complete, the ApsaraDB RDS for MySQL instance begins its failover. At this point, the ECS instance status shows Switchover Succeeded, and the RDS instance status shows Switching Over.

  5. Wait for the disaster recovery set's status to become Switchover Succeeded.

  6. Click View Resources to check the current resource statuses and primary/secondary zone distribution. Compare this with the pre-failover state to confirm that the failover was successful.

  7. A comparison of the resource statuses before and after the failover shows the following:

    • The primary ECS node has completed the failover (its status is Stopped), and the secondary node is running normally.

    • The primary and secondary zones for the ApsaraDB RDS for MySQL instance have been switched. The primary zone has changed from the previous zone k to zone h.

Failback test

The CADT disaster recovery management service allows you to fail back resources to their original state after a fault is resolved.

  1. In the Actions column for the disaster recovery set that has completed the failover, click Switch DR Set Back. Read the prompt carefully and confirm your choice to start the failback. The confirmation dialog box displays the following message: After the switchback, the ECS instance will start, and the database product will switch back to its primary zone. We recommend checking your service and data integrity after the switchback. If data loss occurs, you can restore data from a previously created snapshot. Click I understand the consequences and confirm the switchback to proceed.

  2. In a disaster recovery set with a defined switchover order, resources with a higher order are switched back first, followed by resources with a lower order. The disaster recovery set status changes to Switching Back. In the resource list, the rds resource's status changes to Switching Back, while the ecs resource's status remains Switchover Succeeded.

  3. Wait for all resources to complete the failback process. The status of the disaster recovery set changes to Switchback Succeeded.

  4. Review the failback results. You can see that all resources in the disaster recovery set have returned to their original state: ecs-01 is Running again, the primary zone of the RDS_MySQL instance has switched back to cn-beijing-k, and the secondary zone has switched back to cn-beijing-h.

  5. After the failback is complete, click Export Disaster Recovery Test Report in the Actions column for the disaster recovery plan to download a detailed report of the test.