点击上方“IT那活儿”公众号,关注后了解更多内容,不管IT什么活儿,干就完了!!!
yum -y install epel-release git curl sshpass
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python get-pip.py
wget https://download.pingcap.org/dm-ansible-v2.0.0.tar.gz
[tidb@luyy01 ~]$ tar -zxvf dm-ansible-v2.0.0.tar.gz
[tidb@luyy01 ~]$ mv dm-ansible-v2.0.0 dm-ansible
[tidb@luyy01 ~]$sudo pip install -r ./requirements.txt
cd /home/tidb/dm-ansible
vi hosts.ini
[servers]
192.168.199.62
192.168.199.63
192.168.199.64
[all:vars]
username = tidb
[tidb@luyy01 dm-ansible]$ ansible-playbook -i hosts.ini create_users.yml -u root -k
SSH password:
ansible-playbook local_prepare.yml
## DM modules
[dm_master_servers]
dm_master ansible_host=192.168.199.61 dm_master_port=18261
[dm_worker_servers]
dm-worker1 ansible_host=192.168.199.62 dm_worker_port=18262 source_id="mysql-replica-01" mysql_host=192.168.199.61 mysql_user=admin mysql_password=YUZP1pa88fWbIzudw3bDTEBF6ZUTnw== mysql_port=3306
[dm_portal_servers]
dm_portal ansible_host=192.168.199.61
## Monitoring modules
[prometheus_servers]
prometheus ansible_host=192.168.199.63
[grafana_servers]
grafana ansible_host=192.168.199.63
[alertmanager_servers]
alertmanager ansible_host=192.168.199.63
## Global variables
[all:vars]
cluster_name = test-cluster
ansible_user = tidb
dm_version = v2.0.0
deploy_dir = /home/tidb/deploy
grafana_admin_user = "admin"
grafana_admin_password = "admin"
cd /home/tidb/dm-ansible/resources/bin &&
./dmctl -encrypt abc!@#123
ansible-playbook deploy.yml
ansible-playbook start.yml
cd /home/tidb/deploy/conf
vi dm-master.toml
enable-gtid = false
[[deploy]]
source-id = "mysql-replica-01"
dm-worker = "192.168.199.62:18262"
name: luyayao
task-mode: all
is-sharding: false
clean-dump-file: true
ignore-checking-items: [schema_of_shard_tables]
target-database:
host: 192.168.199.63
port: 4000
user: root
password: KyMi25sGljNJPVL8OV3JrEA=
mysql-instances:
- source-id: mysql-replica-01
meta:
binlog-name: mysql-bin.0000001
binlog-pos: 4
filter-rules: []
route-rules:
- mysql-replica-01.route_rules.1
- mysql-replica-01.route_rules.2
black-white-list: mysql-replica-01.bw_list.1
mydumper-config-name: mysql-replica-01.dump
routes:
mysql-replica-01.route_rules.1:
schema-pattern: employees
table-pattern: ""
target-schema: employees
target-table: ""
mysql-replica-01.route_rules.2:
schema-pattern: employees
table-pattern: "*"
target-schema: employees
filters: {}
black-white-list:
mysql-replica-01.bw_list.1:
do-tables:
- db-name: employees
tbl-name: "*"
do-dbs: []
ignore-tables: []
ignore-dbs: []
mydumpers:
mysql-replica-01.dump:
mydumper-path: bin/mydumper
threads: 4
chunk-filesize: 64
skip-tz-utc: true
extra-args: "--no-locks"
./dmctl -master-addr 192.168.199.61:18261
operate-source create /home/tidb/deploy/conf/dm-master.yaml
cat dm-master.yaml
server-id: 101
source-id: mysql-replica-01
flavor: mysql
enable-relay: false
enable-gtid: false
from:
host: 192.168.199.61
user: admin
password: YUZP1pa88fWbIzudw3bDTEBF6ZUTnw==
port: 3306
start-task -s mysql-replica-01 /home/tidb/deploy/conf/luyayao.yaml
» query-status #查询任务运行状态
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129237.html
摘要:合库合表数据同步在使用支撑大量数据时,经常会选择使用分库分表的方案。但当将数据同步到后,通常希望逻辑上进行合库合表。为支持合库合表的数据同步,主要实现了以下的一些功能。 作者:张学程 简介 TiDB-DM(Data Migration)是用于将数据从 MySQL/MariaDB 迁移到 TiDB 的工具。该工具既支持以全量备份文件的方式将 MySQL/MariaDB 的数据导入到 Ti...
摘要:原理解读介绍项目地址是用于将数据从迁移到的工具。该工具既支持以全量备份文件的方式将的数据导入到,也支持通过解析执行的方式将数据增量同步到。特别地,对于有多个实例的分库分表需要合并后同步到同一个集群的场景,提供了良好的支持。 在刚刚结束的 TiDB DevCon 2019 上,我们宣布将大家期待已久的 TiDB-Ligthning Toolset 和 TiDB-DM 开源(惊不惊喜、意不...
阅读 1249·2023-01-11 13:20
阅读 1558·2023-01-11 13:20
阅读 1012·2023-01-11 13:20
阅读 1680·2023-01-11 13:20
阅读 3971·2023-01-11 13:20
阅读 2519·2023-01-11 13:20
阅读 1355·2023-01-11 13:20
阅读 3486·2023-01-11 13:20