DTS is a data transmission service that integrates such features as data migration, sync, and subscription. It helps you migrate your databases to the cloud without interrupting your business and build a high-availability database disaster recovery architecture through real-time sync channels. Its data subscription feature meets your requirements for commercial data mining and async business decoupling.
DTS for Redis currently supports the data migration feature for you to migrate data to TencentDB in a non-stop manner at a time. In addition, in its full + incremental data migration mode, historical data in the source database written before migration and incremental data written during migration can be migrated together.
DTS for Redis data migration supports source and target databases in the following deployment modes:
Source Database | Target Database | Description |
---|---|---|
Self-built Redis database, such as self-built databases in IDC and CVM | TencentDB for Redis | - |
Third-party Redis | TencentDB for Redis | The third-party cloud vendor must grant the SYNC or PSYNC command permission. |
TencentDB for Redis | TencentDB for Redis | Data migration, version upgrade, and cross-region migration are supported between database instances under the same Tencent Cloud account. |
Note:For compatibility issues with migration from Standalone Edition to Memory Edition (Cluster Architecture), see Check on Migration from Standard Architecture to Cluster Architecture.
SYNC
or PSYNC
commands.DTS supports data migration based on the public network, CVM instances, Direct Connect gateways, VPN, and CCN.
Note:The DTS system will check the following environment requirements before starting a migration task and report an error if a requirement is not met. You can also check them in advance. For more information on error handling, see Check Item Overview.
Type | Environment Requirement |
---|---|
Requirements for source database |
|
Requirements for target database |
|
You should check and make sure that the following items are passed before the migration; otherwise, the migration may fail.
Before the migration, check whether there are big keys in the source database. They may cause the buffer (client-output-buffer-limit) to overflow during the migration, leading to a migration failure.
Evaluate large keys for splitting or cleaning. If you need to retain them, set the source buffer size (client-output-buffer-limit) to infinite.
config set client-output-buffer-limit 'slave 0 0 0'
If the number of concurrent business requests is high, check the limit on the number of connections in the Linux kernel before the migration. If this value is exceeded, the Linux server will actively disconnect from DTS.
echo "net.ipv4.tcp_max_syn_backlog=4096" >> /etc/sysctl.conf
echo "net.core.somaxconn=4096" >> /etc/sysctl.conf
echo "net.ipv4.tcp_abort_on_overflow=0" /etc/sysctl.conf
sysctl -p
Before the migration, check and make sure that the directory where RDB files are stored in the source database is readable; otherwise, the migration will fail.
If the RDB file directory is not readable, run the following command in the source database to set "diskless replication". Then, RDB files will be directly sent to DTS for storage, with no need to be stored in the source database first and then sent.
config set repl-diskless-sync yes
The most challenging problem in migrating data from Standard Edition to Memory Edition (Cluster Architecture) is the command compatibility with usage specifications of Memory Edition (Cluster Architecture).
mget
, mset
, del
, and exists
commands. In the source database, keys that need to engage in multi-key computing can be aggregated into the same slot through a hash tag. For more information on how to use hash tags, see Redis cluster specification. Perform static and dynamic evaluations as instructed in Check on Migration from Standard Architecture to Cluster Architecture.
(1) Log in to the DTS console and click Create Migration Task on the data migration page.
(2) On the Create Migration Task page, select the types and regions of the source and target databases and click Buy Now.
Configure the Source Database Settings and Target Database Settings and click Test Connectivity. After the test is passed, click Save to proceed to the next step.
Setting Type | Configuration Item | Description |
---|---|---|
Task Configuration | Task Name | Set a task name that is easy to identify. |
Running Mode | You can set Immediate execution or Scheduled execution.
| |
Tag | Tags are used to manage resources by category in different dimensions. If the existing tags do not meet your requirements, go to the console to create more. | |
Source Database Settings | Source Database Type | The source database type selected during purchase, which cannot be changed. |
Region | The region selected during purchase, which cannot be changed. | |
Access Type | For a third-party cloud database, you can select Public Network generally or select VPN Access, Direct Connect, or CCN based on your actual network conditions. In this scenario, select Direct Connect or VPN Access. You need to configure VPN-IDC interconnection in this scenario. For the preparations for different access types, see Overview.
| |
VPC-based Direct Connect Gateway | Only VPC-based Direct Connect gateway is supported. Confirm the network type associated with the gateway. | |
VPC | Select a VPC and subnet associated with the VPC-based Direct Connect gateway. | |
Node Type | Single-Node Migration and Cluster Migration are supported. Cluster Migration is used as an example here. Currently, there are no limits on the number of shards and replicas in migration from Cluster Edition Redis to Cluster Edition Redis. | |
Node Info | Enter the addresses and passwords (IP:port:password or IP:port) of all shards of the source database cluster and separate the information of different nodes with line breaks. We strongly recommend you migrate data from a replica node of the source database to avoid any impact on business access to the source database. | |
Target Database Settings | Target Database Type | The target database type selected during purchase, which cannot be changed. |
Region | The target database region selected during purchase, which cannot be changed. | |
Access Type | Select a type based on your scenario. In this document, select Database. | |
Database Instance | Select the instance ID of the target database. |
On the task verification page, verify the task. After the verification is passed, click Start Task.
Return to the data migration task list, and you can see that the task has entered the Preparing status. After 1–2 minutes, the data migration task will be started.
(1) (Optional) If you want to view, delete, or perform other operations on a task, click the task and select the target operation in the Operation column. For more information, see Viewing Task.
(2) If the keys of the source and target databases are the same, click Done in the Operation column to stop the data migration task.
(3) After the migration task status becomes Task successful, verify the data in the target database. If the verification is passed, you can formally cut over the business. For more information, see Cutover Description.
(1) DTS can automatically report event alarms triggered upon migration interruption to keep you informed of any exceptions. For detailed directions, see Configuring Alarm Policy for Data Migration.
(2) DTS allows you to view the monitoring data of various metrics during migration to understand the performance metrics of the system. For more information, see Viewing Monitoring Metric.
Was this page helpful?