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

Scenarios

Before you launch a service, you may deploy it in an environment that simulates real-world scenarios for testing, such as stress testing. At this time, you can clone data from a source AnalyticDB for MySQL cluster into a new 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.
    On the Clusters page of the AnalyticDB for MySQL console, click Synchronize Data in the upper-right corner to go to the DTS console and view the migration task status of the source cluster. 1
  • If you want to restore a cluster to a point in time, the log backup feature is enabled for the cluster.
  • If you want to restore a cluster from a backup set, at least one backup set is available.

Precautions

  • 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 of AnalyticDB for MySQL V3.0.

Time required for restoration

Note The following estimation methods and examples are for reference only.
  • Backup based on a backup set
    You can restore a cluster only from a backup set. AnalyticDB for MySQL downloads the backup set and uses it to create a cluster. The following section describes how to estimate the time required for this backup method:
    • If the source cluster is in Reserved mode, the time required for restoration varies with the backup size and the number of node groups in the cluster. The speed for downloading data from a node group is about 100 MB/s.
      • Formula: Backup 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 create a cluster, the estimated time can be calculated based on the following formula:

        (1 TB × 1024 × 1024)/100 MB/1 node group = 10485.76s

    • If the source cluster is in Elastic Mode, the time required for restoration varies with the backup size and the number of elastic I/O units (EIUs) in the cluster. The speed for downloading data from an EIU is about 100 MB/s. For more information about EIUs, see EIUs.
      • Formula: Backup 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 create a cluster, the estimated time can be calculated based on the following formula:

        (1 TB × 1024 × 1024)/100 MB/1 EIU = 10485.76s

  • Backup based on 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 time required for this backup method varies based on the sizes of the backup set and redo logs.
    • The time required to download a backup set can be calculated by using the formulas described in the preceding section.
    • The time required for redo logs to be restored cannot be estimated. This is because the download and restoration of redo logs are affected by a large number of factors.

Procedure

  1. Log on to the AnalyticDB for MySQL console.
  2. In the upper-left corner of the page, select the region where the cluster resides.
  3. In the left-side navigation pane, click Clusters.
  4. 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.
    Restore a cluster
  5. Configure the parameters 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 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 valid only when Restore Mode is set to Backup Set.
    Backup Point-in-time The point in time to which you want to restore data.
    Note
    • This parameter is valid only when Restore Mode is set 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 version of the AnalyticDB for MySQL cluster. This parameter is automatically set to 3.0. You do not need to specify this parameter.
    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, Region 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.

    A virtual private cloud (VPC) is an isolated network environment that provides enhanced security.

    VPC

    VSwitch

    The VPC where the new cluster resides and the vSwitch to which the new cluster is connected.
    Mode The mode of the new cluster. The mode of the new cluster must be the same as that of the source cluster. For example, if the mode of the source cluster is Reserved mode, this parameter must be set to Reserved mode.
    Edition The edition of the new cluster.
    • If you select Elastic Mode, Edition is automatically set to Elastic Cluster. You do not need to specify this parameter.
    • If you select Reserved mode, Edition is automatically set to Reserved Cluster. You do not need to specify this parameter.

    For more information, see Editions.

    Instance Type The specifications of the new cluster. Valid values:
    • If you select Elastic Mode, Instance Type is automatically set to E32. You do not need to specify this parameter.
    • If you select Reserved mode, Instance Type can be set to C8 or C32.

    For more information, see Editions.

    Computing Resources The computing resources of the new AnalyticDB for MySQL cluster. Computing resources are used for data computing. More computing resources improve the data query speed. We recommend that you reserve more CPU cores for computing resources than those for data resources.
    Note This parameter is available only when Mode is set to Elastic Mode.
    EIUs The free storage I/O resources that are automatically provided by AnalyticDB for MySQL based on the computing resources you purchase. If you want to separately scale out storage resources, set EIUs.

    An EIU is the unit of data that measures the storage performance of AnalyticDB for MySQL in elastic mode for Cluster Edition. You can use EIUs to separately scale out storage resources. For more information, see EIUs.

    Note This parameter is available only when Mode is set to Elastic Mode.
    Node Groups The number of node groups. By default, each node group consists of three nodes (replicas).
    Note This parameter is available only when Mode is set to Reserved mode.
    Capacity The storage capacity of each node group in the new cluster, which is the same as that of each node group in the source cluster. You do not need to specify this parameter.

    If you purchase multiple node groups, you can use the following formula to calculate the total storage capacity of the cluster: Total storage capacity = Storage capacity of a single node group × Number of node groups.

    Note This parameter is available only when Mode is set to Reserved mode.
  6. By default, the billing method of the new cluster is the same as that of the source cluster. Complete the following operations based on the billing method of the source cluster.
    • If the billing method of the source cluster is Subscription, this parameter is automatically set to Subscription.
      Note The default subscription duration of a new cluster is one month and cannot be modified. You can renew the cluster after it is created. For more information, see Renewal.
      1. On the Clone Instance page, confirm your order information, read and select AnalyticDB for MySQL (Subscription) Terms of Service, and then click Buy Now.
      2. On the Purchase page, confirm the information of the unpaid order and the payment method, and then click Purchase.
    • If the billing method of the source cluster is Pay-As-You-Go, this parameter is automatically set to Pay-As-You-Go.

      On the Clone Instance page, confirm your order information, read and select AnalyticDB for MySQL (Pay-as-you-go) Terms of Service, and then click Buy Now.

What to do next

After the cloned cluster is created, you can log on to the new cluster to verify the 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.