All Products
Search
Document Center

:Clone a cluster

Last Updated:Aug 22, 2024

To restore the data of an AnalyticDB for MySQL cluster or perform business testing, such as stress testing, in an environment that simulates real-world scenarios, you can clone an AnalyticDB for MySQL cluster to create a new cluster for subsequent operations.

Prerequisites

  • An AnalyticDB for MySQL Data Lakehouse Edition or Data Warehouse Edition cluster is created.

  • 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 status of migration tasks 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

  • You can close the following data:

    • The database account and password of the source cluster.

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

  • You cannot clone the IP address whitelist settings of the source cluster.

  • When you clone a Data Warehouse Edition cluster, you cannot change the mode of the cluster. For example, you cannot clone a Data Warehouse Edition cluster in reserved mode to create a Data Warehouse Edition cluster in elastic mode.

  • You cannot clone Data Lakehouse Edition clusters across Alibaba Cloud accounts.

Billing rules

You are charged fees for purchasing a new cluster. For more information, see Pricing.

Amount of time required for restoration

Note

The following estimation methods and examples are for reference only.

Restoration from backup sets

You can restore the 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 at which data is downloaded 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 tab of the Clusters page.1

    • Example

      For example, 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, you can calculate the estimated time by using the following formula:

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

  • If the source cluster is not in reserved 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 at which data is downloaded from an EIU is approximately 100 MB/s.

    • 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, 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, you can calculate the estimated time 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 you create the backup set. The amount of time required for this restoration method varies based on the backup set and redo logs.

  • You can calculate the amount of time required to restore the backup set by using the formulas described in the preceding section.

  • You cannot estimate the amount of time required to restore redo logs because the download and restoration of redo logs are affected by multiple factors.

Clone a cluster within an Alibaba Cloud account

  1. Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, click an edition tab. Find the cluster that you want to clone and choose More > Restore Cluster in the Actions column.

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

    Parameter

    Description

    Billing Method

    The billing method of the new cluster.

    Clone Across Alibaba Cloud Accounts

    Specifies whether to clone the cluster across Alibaba Cloud accounts. Select No.

    Source Cluster

    The ID of the 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 the new cluster.

    • Backup Point-in-time: clones data at a specific point in time to the 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 backup start time.

    • This parameter is available only if 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 if 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 in which you want to deploy the new cluster.

    Note

    The new and source clusters must be deployed within the same region but can be deployed in different zones.

    For example, if the source cluster resides in the China (Hangzhou) region, the Region parameter is fixed 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 fixed to VPC. You do not need to specify this parameter.

    VPC

    vSwitch

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

    Activate PrivateLink

    PrivateLink is used to connect your VPCs to the VPCs of Alibaba Cloud services to ensure secure and efficient private connections and prevent potential security risks that may arise from using public connections. You can create clusters only after you activate PrivateLink. Each Alibaba Cloud account needs to activate PrivateLink only once. You are not charged when you activate PrivateLink.

    Note

    If you are not prompted to activate PrivateLink, PrivateLink is already activated and you do not need to select the check box.

    Disk Encryption

    If you select Disk Encryption, the system encrypts data on each data disk of your cluster based on block storage. This way, your data cannot be decrypted even if the data is leaked.

  4. Configure the Edition and corresponding parameters and click Buy Now in the lower-right corner of the page.

  5. 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.

Clone a cluster across Alibaba Cloud accounts

Important

You can clone only Data Warehouse Edition clusters across Alibaba Cloud accounts.

  1. Log on to the Resource Access Management (RAM) console with the Alibaba Cloud account of the source cluster. Configure RAM authorization to ensure that other Alibaba Cloud accounts can read the AnalyticDB for MySQL resources of the source Alibaba Cloud account.

    1. Create a RAM role. For more information, see Create a RAM role for a trusted Alibaba Cloud account.

      Note

      Select Other Alibaba Cloud Account for the Select Trusted Alibaba Cloud Account parameter and enter the ID of a different Alibaba Cloud account. You can log on to the Account Center console to view the Alibaba Cloud account ID on the Security Settings page.

    2. Attach the AliyunADBReadOnlyAccess policy to the RAM role. For more information, see Grant permissions to a RAM role.

    3. Modify the trust policy. For more information, see Edit the trust policy of a RAM role.

      {
        "Statement": [
          {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
              "RAM": [
                "acs:ram::testAccountID:root"
              ],
              "Service": [
                "testAccountID@ads.aliyuncs.com"
              ]
            }
          }
        ],
        "Version": "1"
      }
      Note

      Replace the value of the testAccountID parameter with the ID of a different Alibaba Cloud account.

  2. Log on to the AnalyticDB for MySQL console with a different Alibaba Cloud account. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters.

  3. On the Clusters page, click the Data Warehouse Edition tab.

  4. Find a Data Warehouse Edition cluster and choose More > Restore Cluster in the Actions column.

    The preceding cluster and the source cluster must be in elastic mode or reserved mode. If the existing clusters do not meet this requirement, you must create a new cluster. For more information, see Create a Data Warehouse Edition cluster.

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

    Parameter

    Description

    Billing Method

    The billing method of the new cluster.

    Clone Across Alibaba Cloud Accounts

    Specifies whether to clone the cluster across Alibaba Cloud accounts. Select Yes.

    Cross-account UID

    The UID of the Alibaba Cloud account of the source cluster.

    Cross-account Role

    The name of the RAM role that is created in Step 1.

    Cross-account Cluster ID

    The ID of the source cluster.

    Cross-account Backup Set ID

    The ID of the backup set.

    Source Cluster

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

    Note

    When you clone a cluster across Alibaba Cloud accounts, this parameter is irrelevant and can be ignored.

    Restore Mode

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

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

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

    Note

    When you clone a cluster across Alibaba Cloud accounts, this parameter is irrelevant and can be ignored.

    Backup Set

    The backup set that you want to restore.

    Note
    • This parameter is available only if you set the Restore Mode parameter to Backup Set. When you clone a cluster across Alibaba Cloud accounts, this parameter is irrelevant and can be ignored.

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

    Backup Point-in-time

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

    Note
    • This parameter is available only if you set the Restore Mode parameter to Backup Point-in-time. When you clone a cluster across Alibaba Cloud accounts, this parameter is irrelevant and can be ignored.

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

    Edition

    The edition of the new cluster. This parameter is fixed to Data Warehouse Edition. You do not need to specify this parameter.

    Region

    Zone

    The region and zone in which you want to deploy the new cluster.

    Note

    The new and source clusters must be deployed within the same region but can be deployed in different zones.

    For example, if the source cluster resides in the China (Hangzhou) region, the Region parameter is fixed 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 fixed to VPC. You do not need to specify this parameter.

    VPC

    vSwitch

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

    Activate PrivateLink

    PrivateLink is used to connect your VPCs to the VPCs of Alibaba Cloud services to ensure secure and efficient private connections and prevent potential security risks that may arise from using public connections. You can create clusters only after you activate PrivateLink. Each Alibaba Cloud account needs to activate PrivateLink only once. You are not charged when you activate PrivateLink.

    Note

    If you are not prompted to activate PrivateLink, PrivateLink is already activated and you do not need to select the check box.

    Disk Encryption

    If you select Disk Encryption, the system encrypts data on each data disk of your cluster based on block storage. This way, your data cannot be decrypted even if the data is leaked.

  6. Configure the Edition and corresponding parameters and click Buy Now in the lower-right corner of the page.

  7. 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.

  8. (Optional) If you do not need to use the cluster created in Step 4 after the clone operation is complete, release the cluster at the earliest opportunity. For more information, see Delete or unsubscribe from a cluster.

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 testing on the new cluster. For more information, see Connect to an AnalyticDB for MySQL cluster.