Migrating Data from Redis to DCS
Scenario
CDM can migrate data from the on-premises Redis database or third-party Redis service to DCS without programming. The procedure includes three steps:
Prerequisites
- Your EIP quota is sufficient.
- You have subscribed to DCS and obtained the IP address, port, and password of the DCS database.
- The on-premises Redis database can be accessed through the public network.
- You have obtained the IP address and password of the Redis server.
Creating a CDM Cluster and Binding an EIP to the Cluster
- The DGC basic package includes a CDM cluster. If the cluster cannot meet your requirements, you can buy a CDM incremental package to supplement the DGC basic instance. Create a CDM cluster. For details, see Buying a DGC Incremental Package. The key configurations are as follows:
- The flavor of the CDM cluster is selected based on the amount of data to be migrated. Generally, select cdm.medium to meet the requirements of most migration scenarios.
- The CDM and DCS clusters must be in the same VPC. In addition, it is recommended that the CDM cluster be in the same subnet and security group as the DCS cluster.
- If the subnets and security groups are inconsistent, configure a security group rule to enable the CDM cluster to access the DCS cluster.
- After the CDM cluster is created, click Bind EIP on the Cluster Management page to bind an EIP to the cluster. The CDM cluster uses the EIP to access the on-premises Redis data source.
If SSL encryption is configured for the access channel of a local data source, CDM cannot connect to the data source using the EIP.
Creating the Redis and DCS Links
- Click Job Management in the Operation column of the CDM cluster. On the page that is displayed, choose . The page for selecting a connector is displayed. See Figure 1.
- Select Redis and click Next. On the page that is displayed, configure the Redis link parameters. See Figure 2.
- Name: Enter a custom link name, for example, redis_link.
- Redis Deployment Method: Select a value based on the actual deployment method of the on-premises Redis database.
- Single-node deployment: Select Single.
- Cluster deployment: Select Cluster.
- Redis Server List: Set this parameter to the server address of the on-premises Redis database. Separate multiple server lists by semicolons (;).
- Password and Redis Database Index: Enter the password used for logging in to the on-premises Redis database and the index of the Redis database the data will be exported from.
- Click Save. The Link Management page is displayed.
- On the Link Management tab page, click Create Link to create a DCS link. The procedure for creating a DCS link and the link parameters is the same as those for a Redis link.
- Select Distributed Cache Service, click Next, and configure the DCS link parameters.
- Name: Enter a custom link name, for example, dcs_link.
- Redis Deployment Method: Select a value based on the DCS cluster deployment mode.
- Redis Server List: Set this parameter to the server address lists of the DCS database. Separate multiple server lists with semicolons (;).
- Password and Redis Database Index: Enter the password used for logging in to the DCS database and the index of the database to which data is written.
- Click Save. The Link Management page is displayed.
Creating a Migration Job
- Choose to create a data migration job. See Figure 3.
- Job Name: Enter a unique name, for example, redis2dcs.
- Source Job Configuration
- Source Link Name: Select the Redis link created in Creating the Redis and DCS Links.
- Redis Key Prefix: Select a key prefix that data will be exported from.
- Value Storage Type: Select a value based on your needs. The example shown in the figure uses Hash on both the migration source and destination as an example.
- Retain the default values for the optional parameters in Show Advanced Attributes. For details, see Source Redis Parameters.
- Destination Job Configuration
- Destination Link Name: Select the DCS link created in Creating the Redis and DCS Links.
- Redis Key Prefix: Select a key prefix to which data is to be imported.
- Value Storage Type: Select Hash, which is the same as the migration source.
- Retain the default values of the optional parameters in Show Advanced Attributes. For details, see Destination DCS Parameters.
- After the basic job parameters are configured, click Next to enter the page for configuring field mapping.
For the hash type, you can click the button on the right of Name as highlighted in Figure 4 to copy the fields on the migration source and then select the field that is used as the primary key.
- Click Next. On the Configure Task page that is displayed, use Schedule Execution if required. For details, see Figure 5.
If Schedule Execution is enabled, CDM periodically synchronizes data. If data with duplicate primary keys exists, CDM automatically overwrites the existing primary key.
- Click Save and Run. The Job Management page is displayed, on which you can view the job execution progress and result.
- After the job is successfully executed, in the Operation column of the job, click Historical Record to view the job's historical execution records and read/write statistics.
On the Historical Record page, click Log to view the job logs.
Last Article: Migrating Data from OBS to DLI
Next Article: Migrating Data Oracle to CSS





Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.