TiDB DM 部署

简介

TiDB Data Migration (DM) 是一款便捷的数据迁移工具,支持从与 MySQL 协议兼容的数据库(MySQL、MariaDB、Aurora MySQL)到 TiDB 的全量数据迁移和增量数据同步。使用 DM 工具有利于简化数据迁移过程,降低数据迁移运维成本。

使用 TiUP 部署 DM 集群

前提

  • 已安装TiUP
  • 已安装TiDB
  • 当前版本v7.5.3

安装 TiUP DM 组件
tiup install dm dmctl

编辑初始化配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
global:
user: "tidb"
ssh_port: 22
deploy_dir: "/home/tidb/dm/deploy"
data_dir: "/home/tidb/dm/data"

master_servers:
- host: 10.88.88.70

worker_servers:
- host: 10.88.88.70

monitoring_servers:
- host: 10.88.88.70

grafana_servers:
- host: 10.88.88.70

alertmanager_servers:
- host: 10.88.88.70

执行部署命令
tiup dm deploy dm-cluster v7.5.3 ./topology.yaml --user root -p

查看集群列表
tiup dm list

1
2
3
4
5
[root@hf2 tidb-topo]# tiup dm list
Starting component dm: /root/.tiup/components/dm/v1.16.0/tiup-dm list
Name User Version Path PrivateKey
---- ---- ------- ---- ----------
dm-cluster tidb v7.5.3 /root/.tiup/storage/dm/clusters/dm-cluster /root/.tiup/storage/dm/clusters/dm-cluster/ssh/id_rsa

启动集群
tiup dm start dm-cluster

检查集群状态
tiup dm display dm-cluster

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@hf2 tidb-topo]# tiup dm display dm-cluster
Starting component dm: /root/.tiup/components/dm/v1.16.0/tiup-dm display dm-cluster
Cluster type: dm
Cluster name: dm-cluster
Cluster version: v7.5.3
Deploy user: tidb
SSH type: builtin
Grafana URL: http://10.88.88.70:3000
ID Role Host Ports OS/Arch Status Data Dir Deploy Dir
-- ---- ---- ----- ------- ------ -------- ----------
10.88.88.70:9093 alertmanager 10.88.88.70 9093/9094 linux/x86_64 Up /home/tidb/dm/data/alertmanager-9093 /home/tidb/dm/deploy/alertmanager-9093
10.88.88.70:8261 dm-master 10.88.88.70 8261/8291 linux/x86_64 Healthy|L /home/tidb/dm/data/dm-master-8261 /home/tidb/dm/deploy/dm-master-8261
10.88.88.70:8262 dm-worker 10.88.88.70 8262 linux/x86_64 Free /home/tidb/dm/data/dm-worker-8262 /home/tidb/dm/deploy/dm-worker-8262
10.88.88.70:3000 grafana 10.88.88.70 3000 linux/x86_64 Up - /home/tidb/dm/deploy/grafana-3000
10.88.88.70:9090 prometheus 10.88.88.70 9090 linux/x86_64 Up /home/tidb/dm/data/prometheus-9090 /home/tidb/dm/deploy/prometheus-9090
Total nodes: 5

监控
http://10.88.88.70:3000/