DM V2.x版本worker扩容

问题描述

我的理解
worker server 为 IP,即一台主机
worker 节点为IP:PORT ,一台worker server可以启动多个worker节点

我有3台worker服务器,如果按照默认拓扑进行部署,会启动3个worker节点,端口为:8262
当添加第四个数据源时,会抛出:“msg”: “source is added but there is no free worker to bound”
如果每个数据源都需要一个worker,按照文档说的,都要加一台机器,显然不合适

在DM V1.x版本是可以基于IP:PORT启动多个worker节点的,那DM 2.x版本有没有方法启动多个worker节点呢,实现资源复用。文档没找到方法

如何扩容worker节点呢?

官方文档没说这块,建议加上
这里需要注意,如果您机器资源足够好,可以一台worker server复用多个worker节点

扩容方法:

这里我扩容3个worker节点,端口为8263,ip不变,server复用
如果想继续扩容,可以修改端口为:8264、8265等

vim scale.yaml

worker_servers:
  - host: 172.16.25.247
    port: 8263
  - host: 172.16.25.84
    port: 8263
  - host: 1172.16.25.80
    port: 8263

执行扩容命令

tiup dm scale-out dm-yzh scale.yaml -p

扩容完成后,验证是否生效

[tidb@bj3-tidb_dm-master-prod-01 ~]$ tiup dm display dm-yzh
Starting component `dm`: /home/tidb/.tiup/components/dm/v1.6.0/tiup-dm display dm-yzh
Cluster type:       dm
Cluster name:       dm-yzh
Cluster version:    v2.0.7
Deploy user:        tidb
SSH type:           builtin
ID                  Role          Host           Ports      OS/Arch       Status     Data Dir                              Deploy Dir
--                  ----          ----           -----      -------       ------     --------                              ----------
172.16.25.101:9093  alertmanager  172.16.25.101  9093/9094  linux/x86_64  Up         /data/tidb/dm/data/alertmanager-9093  /data/tidb/dm/deploy/alertmanager-9093
172.16.25.101:8261  dm-master     172.16.25.101  8261/8291  linux/x86_64  Healthy    /data/tidb/dm/data/dm-master-8261     /data/tidb/dm/deploy/dm-master-8261
172.16.25.148:8261  dm-master     172.16.25.148  8261/8291  linux/x86_64  Healthy    /data/tidb/dm/data/dm-master-8261     /data/tidb/dm/deploy/dm-master-8261
172.16.25.42:8261   dm-master     172.16.25.42   8261/8291  linux/x86_64  Healthy|L  /data/tidb/dm/data/dm-master-8261     /data/tidb/dm/deploy/dm-master-8261
172.16.25.247:8262  dm-worker     172.16.25.247  8262       linux/x86_64  Bound      /data/tidb/dm/data/dm-worker-8262     /data/tidb/dm/deploy/dm-worker-8262
172.16.25.247:8263  dm-worker     172.16.25.247  8263       linux/x86_64  Bound      /data/tidb/dm/data/dm-worker-8263     /data/tidb/dm/deploy/dm-worker-8263
172.16.25.80:8262   dm-worker     172.16.25.80   8262       linux/x86_64  Bound      /data/tidb/dm/data/dm-worker-8262     /data/tidb/dm/deploy/dm-worker-8262
172.16.25.80:8263   dm-worker     172.16.25.80   8263       linux/x86_64  Free       /data/tidb/dm/data/dm-worker-8263     /data/tidb/dm/deploy/dm-worker-8263
172.16.25.84:8262   dm-worker     172.16.25.84   8262       linux/x86_64  Bound      /data/tidb/dm/data/dm-worker-8262     /data/tidb/dm/deploy/dm-worker-8262
172.16.25.84:8263   dm-worker     172.16.25.84   8263       linux/x86_64  Free       /data/tidb/dm/data/dm-worker-8263     /data/tidb/dm/deploy/dm-worker-8263
172.16.25.101:3000  grafana       172.16.25.101  3000       linux/x86_64  Up         -                                     /data/tidb/dm/deploy/grafana-3000
172.16.25.101:9090  prometheus    172.16.25.101  9090       linux/x86_64  Up         /data/tidb/dm/data/prometheus-9090    /data/tidb/dm/deploy/prometheus-9090
Total nodes: 12

来自版主 @db_user 的回复:


可以看下这个帖子~

看过,但是并没有说明扩容方法,:joy:

参考一下这里
https://docs.pingcap.com/zh/tidb-data-migration/stable/maintain-dm-using-tiup#扩容节点

2赞