All Products
Search
Document Center

AnalyticDB for MySQL:Clone a cluster

Last Updated:Sep 06, 2023

You can clone a source AnalyticDB for MySQL cluster to create another AnalyticDB for MySQL cluster by using backup sets. This topic describes how to clone an AnalyticDB for MySQL cluster.

Scenarios

To perform business testing such as stress testing, you can deploy your business in an environment that simulates real-world scenarios. In this case, you can clone a source AnalyticDB for MySQL cluster to create another AnalyticDB for MySQL cluster and perform tests on the new cluster. This way, testing accuracy can be ensured without disrupting your business.

Prerequisites

  • The source cluster does not have Data Transmission Service (DTS) migration tasks in progress.

    Note

    You can log on to the DTS console and go to the Data Migration page to view the migration task status of the source cluster.

  • If you want to restore cluster data to a specific point in time, make sure that the log backup feature is enabled for the source cluster.

  • If you want to restore cluster data from backup sets, make sure that the source cluster has at least one backup set.

Usage notes

  • The following data can be cloned:

    • The database account and password of the source cluster.

    • The data that is written to the source cluster before the clone operation starts.

  • The following data cannot be cloned: the whitelist settings of the source cluster.

Pricing

You are charged for the new cluster. For more information, see Pricing for Data Warehouse Edition (V3.0) and Pricing for Data Lakehouse Edition (V3.0).

Amount of time required for restoration

Note

The following estimation methods and examples are for reference only.

Restoration from backup sets

You can restore data of AnalyticDB for MySQL clusters from backup sets. The following section describes how to estimate the amount of time required for this restoration method:

  • If the source cluster is in Reserved Mode, the amount of time required for restoration varies based on the backup size and the number of node groups. The speed for downloading data from a node group is approximately 100 MB/s.

    • Formula: Restoration time = Backup size/100 MB per second/Number of node groups

      You can view the number of Node Groups in the source cluster on the Data Warehouse Edition (V3.0) tab of the Clusters page.1

    • Example

      For example, assume that a source cluster contains a single node group and the size of a backup set is 1 TB. When the backup set is used to restore data to a new cluster, the restoration time can be calculated by using the following formula:

      (1 TB × 1024 × 1024)/100 MB per second/1 node group = 10485.76 seconds

  • If the source cluster is in Elastic Mode, the amount of time required for restoration varies based on the backup size and the number of elastic I/O units (EIUs) in the cluster. The speed for downloading data from an EIU is approximately 100 MB/s. For more information about EIUs, see Use EIUs to scale up storage resources.

    • Formula: Restoration time = Backup size/100 MB per second/Number of EIUs

      You can execute the following statement to query the number of EIUs in the source cluster:

      select count(*) from information_schema.kepler_meta_instance_group;
    • Example

      For example, assume that a source cluster contains a single EIU and the size of a backup set is 1 TB. When the backup set is used to restore data to a new cluster, the restoration time can be calculated by using the following formula:

      (1 TB × 1024 × 1024)/100 MB per second/1 EIU = 10485.76 seconds

Restoration to a point in time

You can restore a cluster to a specific point in time by using a complete backup set and the redo logs created after the backup set. The amount of time required for this restoration method varies based on the backup set and redo logs.

  • The amount of time required to restore the backup set can be calculated by using the formulas described in the preceding section.

  • The amount of time required to restore redo logs cannot be estimated. This is because the download and restoration of redo logs are affected by multiple factors.

Procedure

Source cluster in elastic mode

If the source cluster is in elastic mode, you can set the edition of the new cluster to Data Lakehouse Edition or Data Warehouse Edition.

  1. Log on to the AnalyticDB for MySQL console.

  2. In the upper-left corner of the console, select a region.

  3. On the Data Warehouse Edition (V3.0) tab, find the cluster that you want to clone and choose More > Restore Cluster in the Actions column.

  4. Configure the parameters that are described in the following table.

    Parameter

    Description

    Source Cluster

    The ID of the AnalyticDB for MySQL cluster that you want to clone. You do not need to specify this parameter.

    Restore Mode

    The method that is used to clone the cluster. Valid values:

    • Backup Set: clones data from a backup set to a new cluster.

    • Backup Point-in-time: clones data at a specific point in time to a new cluster.

    Backup Set

    The backup set that you want to restore.

    Note
    • The backup start time of each backup set is displayed. You can select the backup set that you want to restore based on the time.

    • This parameter is available only when you set the Restore Mode parameter to Backup Set.

    Backup Point-in-time

    The point in time to which you want to restore data.

    Note
    • This parameter is available only when you set the Restore Mode parameter to Backup Point-in-time.

    • You can set this parameter to a point in time from 5 minutes to seven days before the current time.

    Region

    Zone

    The region and zone where the new cluster is located.

    Note

    The new and source clusters must be located within the same region.

    For example, if the source AnalyticDB for MySQL cluster resides in the China (Hangzhou) region, the Region parameter is automatically set to China (Hangzhou) for the new cluster. You do not need to specify this parameter.

    Network Type

    The network type of the new cluster. This parameter is automatically set to VPC. You do not need to specify this parameter.

    VPC

    VSwitch

    The virtual private cloud (VPC) in which the new cluster resides and the vSwitch to which the new cluster is connected.

  5. Set the Edition parameter to Data Lakehouse Edition or Data Warehouse Edition, configure the corresponding parameters, and then click Buy Now in the lower-right corner of the page.

    Data Lakehouse Edition

    Parameter

    Description

    Reserved Computing Resources

    The reserved computing resources of the new cluster.

    Reserved Storage Resources

    The reserved storage resources of the new cluster.

    Data Warehouse Edition

    Set the Mode parameter to Elastic Mode or Reserved Mode and configure the corresponding parameters.

    Note

    For more information about the elastic mode and reserved mode, see Editions.

    Reserved mode

    The following table describes the parameters that must be configured if you select Reserved Mode.

    Parameter

    Description

    Edition (Old)

    For Reserved Mode, the Edition parameter is automatically set to Reserved Cluster. You do not need to specify this parameter.

    Instance Type

    The instance type of the cluster. Valid values: C8 and C32.

    Node Groups

    The number of node groups. By default, each node group consists of three nodes.

    Capacity

    The storage of a single node group. Total storage = Storage per node group × Number of node groups.

  6. Perform the subsequent purchase operations as prompted based on the Product Type parameter of the source cluster.

    Approximately 20 minutes after you complete the payment, you can view the new cluster on the Clusters page.

Source cluster in reserved mode

  1. Log on to the AnalyticDB for MySQL console.

  2. In the upper-left corner of the console, select a region.

  3. On the Data Warehouse Edition (V3.0) tab, find the cluster that you want to clone and choose More > Restore Cluster in the Actions column.

  4. Configure the parameters that are described in the following table.

    Parameter

    Description

    Source Cluster

    The ID of the AnalyticDB for MySQL cluster that you want to clone. You do not need to specify this parameter.

    Restore Mode

    The method that is used to clone the cluster. Valid values:

    • Backup Set: clones data from a backup set to a new cluster.

    • Backup Point-in-time: clones data at a specific point in time to a new cluster.

    Backup Set

    The backup set that you want to restore.

    Note
    • The backup start time of each backup set is displayed. You can select the backup set that you want to restore based on the time.

    • This parameter is available only when you set the Restore Mode parameter to Backup Set.

    Backup Point-in-time

    The point in time to which you want to restore data.

    Note
    • This parameter is available only when you set the Restore Mode parameter to Backup Point-in-time.

    • You can set this parameter to a point in time from 5 minutes to seven days before the current time.

    Version

    The edition of the new AnalyticDB for MySQL cluster. This parameter is automatically set to Data Warehouse Edition.

    Region

    Zone

    The region and zone where the new cluster is located.

    Note

    The new and source clusters must be located within the same region.

    For example, if the source AnalyticDB for MySQL cluster resides in the China (Hangzhou) region, the Region parameter is automatically set to China (Hangzhou) for the new cluster. You do not need to specify this parameter.

    Network Type

    The network type of the new cluster. This parameter is automatically set to VPC. You do not need to specify this parameter.

    VPC

    VSwitch

    The VPC in which the new cluster resides and the vSwitch to which the new cluster is connected.

  5. Set the Mode parameter to Elastic Mode or Reserved Mode, configure the corresponding parameters, and then click Buy Now in the lower-right corner of the page.

    Note

    For more information about the elastic mode and reserved mode, see Editions.

    Elastic mode

    The following table describes the parameters that must be configured if you select Elastic Mode.

    Parameter

    Description

    Edition (Old)

    For Elastic Mode, the Edition parameter is automatically set to Elastic Cluster. You do not need to specify this parameter.

    Computing Resources

    The computing resources of the new AnalyticDB for MySQL cluster.

    The computing resources of the cluster. You can use computing resources to compute data. The increase in the amount of computing resources can accelerate data queries.

    If you select computing resources of 32 cores or more, you can use the computing resources for hot and cold data separation, resource groups, and elastic resource scaling.

    Hot Data Storage Space Description

    Cold Data Storage Space Description

    • Hot data refers to data that is frequently accessed. Hot data is stored in enhanced SSDs (ESSDs) to provide high I/O performance and deliver high-performance access.

    • Cold data refers to data that is infrequently accessed. Cold data is cost-effective because it is stored in Object Storage Service (OSS).

    EIUs

    When you create a cluster, AnalyticDB for MySQL provides free storage I/O resources based on the computing resources that you purchase. To scale up your storage resources, specify the EIUs parameter.

    EIU Capacity

    The single-node specifications of an EIU for an elastic cluster. This parameter is automatically set to 8Core64GB. You do not need to specify this parameter.

    Reserved mode

    The following table describes the parameters that must be configured if you select Reserved Mode.

    Parameter

    Description

    Edition (Old)

    For Reserved Mode, the Edition parameter is automatically set to Reserved Cluster. You do not need to specify this parameter.

    Instance Type

    The instance type of the cluster. Valid values: C8 and C32.

    Node Groups

    The number of node groups. By default, each node group consists of three nodes.

    Capacity

    The storage of a single node group. Total storage = Storage per node group × Number of node groups.

  1. Perform the subsequent purchase operations as prompted based on the Product Type parameter of the source cluster.

    Approximately 20 minutes after you complete the payment, you can view the new cluster on the Clusters page.

What to do next

After the new cluster is created, you can connect to the new cluster to verify data. After you check the data integrity, you can perform operations such as business tests on the new cluster. For more information, see Connect to an AnalyticDB for MySQL cluster.