1、对现在 dm 集群进行缩容,将 free 状态的 worker 下线。

tiup dm display dm-test
查看 free 状态节点
tiup dm scale-in dm 172.16.1.13:8262 -N

2、扩容 DM 集群

我是在一个机器上启的多实例,所以用的是另一个端口

#配置文件
worker_servers:
- host: 172.16.1.13
ssh_port: 22
port: 8263
deploy_dir: "/dm-deploy/dm-worker-8263"
log_dir: "/dm-deploy/dm-worker-8263/log"
[root@root dm]# tiup dm scale-out dm-test dm-scale.yaml -uroot -p
tiup is checking updates for component dm ...
Starting component `dm`: /root/.tiup/components/dm/v1.11.1/tiup-dm scale-out dm-test dm-scale.yaml -uroot -p
Input SSH password: + Detect CPU Arch Name
- Detecting node 172.16.1.13 Arch info ... Done + Detect CPU OS Name
- Detecting node 172.16.1.13 OS info ... Done
Please confirm your topology:
Cluster type: dm
Cluster name: dm-test
Cluster version: v6.4.0
Role Host Ports OS/Arch Directories
---- ---- ----- ------- -----------
dm-worker 172.16.1.13 8263 linux/x86_64 /dm-deploy/dm-worker-8263,/dm-data/dm-worker-8263
Attention:
1. If the topology is not what you expected, check your yaml file.
2. Please confirm there is no port/directory conflicts in same host.
Do you want to continue? [y/N]: (default=N) y
+ [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/dm/clusters/dm-test/ssh/id_rsa, publicKey=/root/.tiup/storage/dm/clusters/dm-test/ssh/id_rsa.pub
+ [Parallel] - UserSSH: user=root, host=172.16.1.13
+ [Parallel] - UserSSH: user=root, host=172.16.1.13
+ [Parallel] - UserSSH: user=root, host=172.16.1.13
+ [Parallel] - UserSSH: user=root, host=172.16.1.13
+ [Parallel] - UserSSH: user=root, host=172.16.1.13
+ Download TiDB components
- Download dm-worker:v6.4.0 (linux/amd64) ... Done
+ Initialize target host environments
+ Deploy TiDB instance
- Deploy instance dm-worker -> 172.16.1.13:8263 ... Done
+ Copy certificate to remote host
+ Generate scale-out config
- Generate scale-out config dm-worker -> 172.16.1.13:8263 ... Done
+ Init monitor config
Enabling component dm-worker
Enabling instance 172.16.1.13:8263
Enable instance 172.16.1.13:8263 success
+ [ Serial ] - Save meta
+ [ Serial ] - Start new instances
Starting component dm-worker
Starting instance 172.16.1.13:8263
Start instance 172.16.1.13:8263 success
+ Refresh components conifgs
- Generate config dm-master -> 172.16.1.13:8261 ... Done
- Generate config dm-worker -> 172.16.1.13:8262 ... Done
- Generate config dm-worker -> 172.16.1.13:8263 ... Done
- Generate config prometheus -> 172.16.1.13:9090 ... Done
- Generate config grafana -> 172.16.1.13:3000 ... Done
- Generate config alertmanager -> 172.16.1.13:9093 ... Done
+ Reload prometheus and grafana
- Reload prometheus -> 172.16.1.13:9090 ... Done
- Reload grafana -> 172.16.1.13:3000 ... Done
Scaled cluster `dm-test` out successfully

再次查看集群状态

[root@root dm]# tiup dm display dm-test
tiup is checking updates for component dm ...
Starting component `dm`: /root/.tiup/components/dm/v1.11.1/tiup-dm display dm-test
Cluster type: dm
Cluster name: dm-test
Cluster version: v6.4.0
Deploy user: root
SSH type: builtin
Grafana URL: http://172.16.1.13:3000
ID Role Host Ports OS/Arch Status Data Dir Deploy Dir
-- ---- ---- ----- ------- ------ -------- ----------
172.16.1.13:9093 alertmanager 172.16.1.13 9093/9094 linux/x86_64 Up /dm-data/alertmanager-9093 /dm-deploy/alertmanager-9093
172.16.1.13:8261 dm-master 172.16.1.13 8261/8291 linux/x86_64 Healthy|L /dm-data/dm-master-8261 /dm-deploy/dm-master-8261
172.16.1.13:8262 dm-worker 172.16.1.13 8262 linux/x86_64 Bound /dm-data/dm-worker-8262 /dm-deploy/dm-worker-8262
172.16.1.13:8263 dm-worker 172.16.1.13 8263 linux/x86_64 Free /dm-data/dm-worker-8263 /dm-deploy/dm-worker-8263
172.16.1.13:3000 grafana 172.16.1.13 3000 linux/x86_64 Up - /dm-deploy/grafana-3000
172.16.1.13:9090 prometheus 172.16.1.13 9090 linux/x86_64 Up /dm-data/prometheus-9090 /dm-deploy/prometheus-9090

4、停止复制任务

[root@root dm]#  tiup dmctl --master-addr 172.16.1.13:8261 stop-task dm_task.yml
tiup is checking updates for component dmctl ...
Starting component `dmctl`: /root/.tiup/components/dmctl/v6.4.0/dmctl/dmctl --master-addr 172.16.1.13:8261 stop-task dm_task.yml
{
"op": "Delete",
"result": true,
"msg": "",
"sources": [
{
"result": true,
"msg": "",
"source": "mysql-01",
"worker": "dm-172.16.1.13-8262"
}
]
}

5、关闭 DM 集群

[root@root dm]# tiup dm stop dm-test

6、销毁 DM 集群

tiup dm destory dm-test

7、其它

即使停了同步任务,但 worker 节点也不是 free 状态,因为之前创建过数据源,绑定到了 worker 节点,需要将 数据源停掉。

[root@root dm]# tiup dmctl --master-addr 172.16.1.13:8261 operate-source stop source-mysql-01.yaml
tiup is checking updates for component dmctl ...
Starting component `dmctl`: /root/.tiup/components/dmctl/v6.4.0/dmctl/dmctl --master-addr 172.16.1.13:8261 operate-source stop source-mysql-01.yaml
{
"result": true,
"msg": "",
"sources": [
{
"result": true,
"msg": "",
"source": "mysql-01",
"worker": "dm-172.16.1.13-8262"
}
]
}

再次查看集群信息, worker 节点都是 free 状态。

[root@root dm]# tiup dm display dm-test
tiup is checking updates for component dm ...
Starting component `dm`: /root/.tiup/components/dm/v1.11.1/tiup-dm display dm-test
Cluster type: dm
Cluster name: dm-test
Cluster version: v6.4.0
Deploy user: root
SSH type: builtin
Grafana URL: http://172.16.1.13:3000
ID Role Host Ports OS/Arch Status Data Dir Deploy Dir
-- ---- ---- ----- ------- ------ -------- ----------
172.16.1.13:9093 alertmanager 172.16.1.13 9093/9094 linux/x86_64 Up /dm-data/alertmanager-9093 /dm-deploy/alertmanager-9093
172.16.1.13:8261 dm-master 172.16.1.13 8261/8291 linux/x86_64 Healthy|L /dm-data/dm-master-8261 /dm-deploy/dm-master-8261
172.16.1.13:8262 dm-worker 172.16.1.13 8262 linux/x86_64 Free /dm-data/dm-worker-8262 /dm-deploy/dm-worker-8262
172.16.1.13:8263 dm-worker 172.16.1.13 8263 linux/x86_64 Free /dm-data/dm-worker-8263 /dm-deploy/dm-worker-8263
172.16.1.13:3000 grafana 172.16.1.13 3000 linux/x86_64 Up - /dm-deploy/grafana-3000
172.16.1.13:9090 prometheus 172.16.1.13 9090 linux/x86_64 Up /dm-data/prometheus-9090 /dm-deploy/prometheus-9090
Total nodes: 6

TIDB-DM数据迁移第三部(集群管理)的更多相关文章

  1. 数据迁移_老集群RAC迁移数据恢复到新集群RAC

    数据迁移_老集群RAC迁移数据恢复到新集群RAC 作者:Eric 微信:loveoracle11g 1.把老集群RAC备份的数据远程拷贝到新集群RAC [root@old-rac-node1 ~]# ...

  2. Bash实践:抽样检测数据迁移至Redis集群后的数据一致性

    熟悉了一段时间的Bash编程,因此借此任务操作一把bash编程,主要涉及到Redis单节点与Redis集群的操作 1. 任务背景 近日有个任务需要将历史的Redis(主从节点)中的数据迁移至Redis ...

  3. Redis单机数据迁移至Sentinel集群

    <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...

  4. hadoop hdfs 数据迁移到其他集群

    # hadoop fs -cat /srclist Warning: $HADOOP_HOME is deprecated. hdfs://sht-sgmhadoopcm-01:9011/jdk-6u ...

  5. 从零自学Hadoop(17):Hive数据导入导出,集群数据迁移下

    阅读目录 序 将查询的结果写入文件系统 集群数据迁移一 集群数据迁移二 系列索引 本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephis ...

  6. Redis单节点数据同步到Redis集群

    一:Redis集群环境准备 1:需要先安装好Redis集群环境并配置好集群 192.168.0.113 7001-7003 192.168.0.162 7004-7006 2:检查redis集群 [r ...

  7. 使用Velero Restic快速完成云原生应用迁移至ACK集群

    本文记录使用Velero Restic快速完成云原生应用迁移至ACK集群的实践过程. 0. 实践步骤概览 (1)创建GKE集群(或自建Kubernetes集群)(2)在GKE集群上部署示例应用Jenk ...

  8. 大数据平台搭建-zookeeper集群的搭建

    本系列文章主要阐述大数据计算平台相关框架的搭建,包括如下内容: 基础环境安装 zookeeper集群的搭建 kafka集群的搭建 hadoop/hbase集群的搭建 spark集群的搭建 flink集 ...

  9. 数据库机器迁移对AlwaysON 集群影响测试

    1主3从(共享文件见证)     模拟事故 AlwaysON集群 结论 主域控服务器重启 共享文件夹见证失败,SQL集群无影响 无影响 修改共享文件夹见证路径 第一次测试修改后:整个集群突然重启,查询 ...

  10. 大数据【一】集群配置及ssh免密认证

    八月迷情,这个月会对大数据进行一个快速的了解学习. 一.所需工具简介 首先我是在大数据实验一体机上进行集群管理学习,管理五台实验机,分别为master,slave1,slave2,slave3,cli ...

随机推荐

  1. 安卓开发 java控制UI

    创建布局管理器对象 设置背景 设置活动界面 按钮事件 按钮显示

  2. socket.io实现简易聊天室功能

    本文简单介绍使用websocket实现一个简单的聊天室功能,我这里是用vite初始化的vue3项目. 在线体验地址:http://chat.lb0125.com/chat 需要安装的库: socket ...

  3. 深度学习-LSTM

    目录 前言 神经网络的历史和背景 循环神经网络的出现及其作用 LSTM在处理序列数据中的应用 LSTM的基本原理 LSTM的结构和原理 遗忘门.输入门.输出门的作用 LSTM的训练方法 代码 LSTM ...

  4. P4238 【模板】多项式乘法逆

    #include <cstdio> #include <iostream> #define re register using namespace std; typedef l ...

  5. 双端队列xLIS问题

    题目大意 有 \(N\) 个数 \(A_i\) ,他准备将他们依次插入一个双端队列(每次可以在头或尾插入一个元素),最后将 整个队列从尾到头看成一个序列,求出最长上升子序列的长度 .他想知道 , \( ...

  6. docker-compose部署rocketmq

    docker-compose安装: 1.从github上下载docker-compose二进制文件安装 Ubuntu下载docker-compose文件 sudo curl -L https://gi ...

  7. PostgreSQL的10进制与16进制互转

    1.10进制转16进制Postgres里面有一个内置的10进制转16进制的函数:to_hex(int)/to_hex(bigint) [postgres@localhost ~]$ psql Pass ...

  8. MTU设置不当导致ssh运行命令卡死

    MTU:最大网络传输单元,计算机网络课会介绍. 场景: 本地通过VPN连接某个机房内网的linux服务器,连接上之后,运行top命令.vi命令.yum update等需要刷新大量内容时导致ssh卡死, ...

  9. 不可忽略的.gitignore_global

    会不会很奇怪,本地的代码运行没有问题,以为自己提交到远程仓库了 但是别人下载下来却没有,有没有可能是你根本没提交上去,对了,你真的有可能没提交上去 你本地这个文件是灰色的,确实没有提交上去,但是项目中 ...

  10. pictrue类的练习

    这里遇到一个问题,因为导入的文件格式很大,所以内存占用特别高,就会在运行一段时间过后报错:内存不够 然后用了一个GC.collect():的方法,加在了timer控件里,让程序每隔1000ms换图时也 ...