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.
- 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
- Backup based on a backup setYou 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.
- 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
- Formula: Backup restoration time = Backup size/100 MB per second/Number of node groups
- 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
- Formula: Backup restoration time = Backup size/100 MB per second/Number of EIUs
- 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.
- Backup based on a point in timeYou 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
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.