TiDB Data Migration (DM) 项目教程

TiDB Data Migration (DM) 项目教程

docs-dmDocumentation for the TiDB Data Migration (DM) tool in both English and Chinese.项目地址:https://gitcode.com/gh_mirrors/do/docs-dm

1. 项目的目录结构及介绍

TiDB Data Migration (DM) 项目的目录结构如下:

docs-dm/
├── assets/
│   └── get-started/
├── en/
├── hack/
├── media/
├── scripts/
├── templates/
├── zh/
├── .editorconfig
├── .gitignore
├── .markdownlint.yaml
├── CONTRIBUTING.md
├── LICENSE
├── README.md

目录结构介绍

  • assets/: 包含项目相关的资源文件。
  • en/: 英文文档目录。
  • hack/: 包含一些脚本和工具。
  • media/: 媒体文件目录。
  • scripts/: 脚本文件目录。
  • templates/: 模板文件目录。
  • zh/: 中文文档目录。
  • .editorconfig: 编辑器配置文件。
  • .gitignore: Git 忽略文件配置。
  • .markdownlint.yaml: Markdown 格式检查配置。
  • CONTRIBUTING.md: 贡献指南。
  • LICENSE: 项目许可证。
  • README.md: 项目介绍文档。

2. 项目的启动文件介绍

TiDB Data Migration (DM) 项目的启动文件主要是 dmctl,它是一个命令行工具,用于管理和操作 DM 集群。

dmctl 介绍

dmctl 是 DM 项目的核心工具,用于以下操作:

  • 启动和管理 DM 集群。
  • 检查和配置数据迁移任务。
  • 监控和管理迁移进度。

使用 dmctl 的基本命令如下:

./dmctl --master-addr <master-addr> <command> <sub-command> <arguments>

其中:

  • master-addr: DM 集群的 Master 节点地址。
  • command: 主要命令,如 start-taskcheck-task 等。
  • sub-command: 子命令,具体操作。
  • arguments: 命令参数。

3. 项目的配置文件介绍

TiDB Data Migration (DM) 项目的配置文件主要包括以下几种:

3.1. DM 集群配置文件

DM 集群配置文件通常位于 conf/ 目录下,包含以下文件:

  • dm-master.toml: DM Master 节点配置文件。
  • dm-worker.toml: DM Worker 节点配置文件。

3.2. 数据迁移任务配置文件

数据迁移任务配置文件通常位于 conf/task/ 目录下,包含以下文件:

  • task.yaml: 数据迁移任务配置文件。

配置文件示例

以下是一个简单的 task.yaml 配置文件示例:

name: "test"
task-mode: "all"
is-sharding: true
enable-heartbeat: false
ignore-checking-items: ["auto_increment_ID"]

mysql-instances:
  - source-id: "mysql-replica-01"
    server-id: 101
    black-white-list: "instance"
    route-rules: ["instance-route-rule"]
    filter-rules: ["instance-filter-rule"]
    column-mapping-rules: ["instance-column-mapping"]
    mydumper-config-name: "global"
    loader-config-name: "global"
    syncer-config-name: "global"

black-white-list:
  instance:
    do-tables:
      - db-name: "test_db"
        tbl-name: "test_table"

mydumpers:
  global:
    threads: 4
    chunk-filesize: 64

loaders:
  global:
    pool-size: 16
    dir: "./dumped_data"

syncers:
  global:
    worker-count: 16
    batch: 100

配置文件说明

  • name: 任务名称。
  • task-mode: 任务模式,可选值为 allfullincremental
  • mysql-instances: MySQL 实例配置。
  • black-white-list: 黑白名单配置。
  • mydumpers:

docs-dmDocumentation for the TiDB Data Migration (DM) tool in both English and Chinese.项目地址:https://gitcode.com/gh_mirrors/do/docs-dm

  • 6
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

纪亚钧

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值