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 to perform tests. This way, you can perform accurate testing 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 configurations of the source cluster.

Pricing

You are charged for the new cluster. For more information, see Billing methods and prices.

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/s/Number of node groups
        You can view the number of Node Groups in the source cluster on the V3.0 Clusters 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/s/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 EIU, see EIUs.
      • Formula: Backup restoration time = Backup size/100 MB/s/Number of EIUs
        You can view the number of Elastic IO Resources in the source cluster on the V3.0 Clusters tab of the Clusters page.2
      • 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/s/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 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 by your Alibaba Cloud account.
  2. In the upper-left corner of the page, select the region where clusters reside.
  3. In the left-side navigation pane, click Clusters.
  4. On the V3.0 Clusters tab, find the cluster that you want to clone and choose More > Restore Cluster in the Actions column.
    Restore Cluster
  5. Specify the following parameters.
    Parameter Description
    Source Cluster The ID of the AnalyticDB for MySQL cluster to be cloned. 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 and vSwitch of the new cluster.
    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. The data query speed increases with the number of computing resources. We recommend that you reserve more CPU cores for computing resources than those for data resources.
    Note This parameter is valid only when Mode is set to Elastic mode.
    Elastic IO Resources When you create a cluster, AnalyticDB for MySQL automatically provides free storage I/O resources based on the computing resources you purchase. If you want to separately scale out storage resources, set Elastic IO Resources.

    Elastic IO Resources is the unit of data that measures the storage performance of AnalyticDB for MySQL in elastic clusters. You can use EIUs to separately scale out storage resources. For more information, see EIUs.

    Note This parameter is valid 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 valid only when Mode is set to Reserved mode.
    Capacity The storage space 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 space of the cluster: Total storage space of a cluster = Storage space of a single node group × Number of node groups.

    Note This parameter is valid 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 subsequent 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 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.