PingKai Logo下载

数据迁移工具概览

平凯数据库提供了丰富的数据迁移相关的工具,用于全量迁移、增量迁移、备份恢复、数据同步等多种场景。

本文介绍了使用这些工具的场景、支持的上下游、优势和相关限制等信息。请根据你的需求选择合适的工具。

TiDB Data Migration (DM)

使用场景用于将数据从与 MySQL 协议兼容的数据库迁移到平凯数据库
上游MySQL,MariaDB,Aurora
下游平凯数据库
主要优势* 一体化的数据迁移任务管理工具,支持全量迁移和增量同步
* 支持对表与操作进行过滤
* 支持分库分表的合并迁移
使用限制数据导入速度与 TiDB Lightning 的逻辑导入模式大致相同,而比 TiDB Lightning 的物理导入模式低很多。建议用于 1 TB 以内的存量数据迁移。

TiDB Lightning

使用场景用于将数据全量导入到平凯数据库
上游(输入源文件)* Dumpling 输出的文件
* 从 Amazon Aurora 或 Apache Hive 导出的 Parquet 文件
* CSV 文件
* 从本地盘或 Amazon S3 云盘读取数据
下游平凯数据库
主要优势* 支持快速导入大量数据,实现快速初始化平凯数据库集群的指定表
* 支持断点续传
* 支持数据过滤
使用限制* 如果使用物理导入模式进行数据导入,TiDB Lightning 运行后,TiDB 集群将无法正常对外提供服务。
* 如果你不希望 TiDB 集群的对外服务受到影响,可以参考 TiDB Lightning 逻辑导入模式中的硬件需求与部署方式进行数据导入。

Dumpling

使用场景用于将数据从 MySQL/TiDB 进行全量导出
上游MySQL,平凯数据库
下游(输出文件)SQL,CSV
主要优势* 支持全新的 table-filter,筛选数据更加方便
* 支持导出到 Amazon S3 云盘
使用限制* 如果导出后计划往非平凯数据库的数据库恢复,建议使用 Dumpling。
* 如果导出后计划往另一个平凯数据库恢复,建议使用 BR

TiCDC

Backup & Restore (BR)

sync-diff-inspector

使用 TiUP 快速安装

TiUP 作为软件包管理器,可帮助你轻松管理平凯数据库生态系统中的不同集群组件。现在你可以只用一个 TiUP 命令行来管理任何组件。

第 1 步:安装 TiUP

curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh

重新声明全局环境变量:

source ~/.bash_profile

第 2 步:安装组件

你可以通过以下命令查看可用组件:

tiup list

输出如下:

Available components:
Name            Owner      Description
----            -----      -----------
PCC             community  A tool used to capture plan changes among different versions of TiDB
bench           pingcap    Benchmark database with different workloads
br              pingcap    TiDB/TiKV cluster backup restore tool.
cdc             pingcap    CDC is a change data capture tool for TiDB
chaosd          community  An easy-to-use Chaos Engineering tool used to inject failures to a physical node
client          pingcap    Client to connect playground
cluster         pingcap    Deploy a TiDB cluster for production
ctl             pingcap    TiDB controller suite
dm              pingcap    Data Migration Platform manager
dmctl           pingcap    dmctl component of Data Migration Platform.
errdoc          pingcap    Document about TiDB errors
pd-recover      pingcap    PD Recover is a disaster recovery tool of PD, used to recover the PD cluster which cannot start or provide services normally.
playground      pingcap    Bootstrap a local TiDB cluster for fun
tidb            pingcap    TiDB is an open source distributed HTAP database compatible with the MySQL protocol.
tidb-dashboard  pingcap    TiDB Dashboard is a Web UI for monitoring, diagnosing, and managing the TiDB cluster
tidb-lightning  pingcap    TiDB Lightning is a tool used for fast full import of large amounts of data into a TiDB cluster
tikv-br         pingcap    TiKV cluster backup restore tool
tikv-cdc        pingcap    TiKV-CDC is a change data capture tool for TiKV
tiproxy         pingcap    TiProxy is a database proxy that is based on TiDB.
tiup            pingcap    TiUP is a command-line component management tool that can help to download and install TiDB platform components to the local system

选择所需要的一个或多个组件进行安装。示例如下:

tiup install dm
tiup install dm tidb-lightning

第 3 步: 更新 TiUP 及组件 (可选)

建议先查看新版本的更新日志及兼容性说明:

tiup update --self && tiup update dm

探索更多