tidb v.4.0.10扩容pd节点

【 TiDB 使用环境】生产环境
【 TiDB 版本】 v4.0.10
【遇到的问题:问题现象及影响】扩容pd节点失败

1.前情摘要:

pd 三个节点(分别为10.11.22.21,10.11.22.22,10.11.22.23),有一个节点的主机磁盘故障,造成一个pd节点(10.11.22.23)down掉

第1步:
为了规避风险,想扩容一台pd,结果扩容失败
窗口显示信息如下:

Error: failed to start pd: failed to start: pd 10.11.22.11:2379, please check the instance’s log(/data/tidb/deploy/pd-2379/log) for more detail.: timed out waiting for port 2379 to be started after 2m0s

Verbose debug logs has been written to /home/tidb/.tiup/logs/tiup-cluster-debug-2024-04-24-01-04-53.log.
Error: run /home/tidb/.tiup/components/cluster/v1.3.6/tiup-cluster (wd:/home/tidb/.tiup/data/UAmxAAr) failed: exit status 1

第2步:扩容失败之后,想scale-in 10.11.22.11为新的pd节点
发现scale-out失败

第3步: 想scale-in 10.11.22.11 ,执行错命令,执行成了
tiup cluster scale-in cluster-name --node 10.11.22.21:2379 --force

4.第4步:发现自己执行错了,再次执行scale-out
pd_servers:

  • host: 10.11.22.21
    ssh_port: 22
    client_port: 2379
    peer_port: 2380
    deploy_dir: /data/tidb/deploy/pd-2379
    data_dir: /data/tidb/data/pd-2379

没有显示成功和start之类的信息,窗口显示日志为scp 10.11.22.23(磁盘有问题,down掉的主机)失败之类的信息

5.但是执行tiup cluster display test的时候发现,发现10.11.22.21 是up的状态
10.11.21.21的pd.log 有内容如下
[2024/04/24 01:33:10.350 +08:00] [WARN] [grpclog.go:60] [“grpc: addrConn.createTransport failed to connect to {http://10.11.22.23:2379 0 }. Err :connection error: desc = "transport: Error while dialing dial tcp 10.11.22.23:2379: connect: connection refused". Reconnecting…”]
[2024/04/24 01:33:11.919 +08:00] [WARN] [proxy.go:181] [“fail to recv activity from remote, stay inactive and wait to next checking round”] [remote=10.11.22.18:10080] [interval=2s] [error=“dial tcp 10.11.22.18:10080: connect: connection refused”]

6.通过工具测试集群,创建表和插入数据均无问题

问题:我怎么才能在现有的情况下,成功扩容pd,来规避一定的风险

没有遇到这种场景,我简单说一下我的基本步骤,根据你的问题

  1. 查看pd集群状态是否正常(超过半数的)
    tiup ctl:v6.1.2 pd cluster -u http://127.0.0.1:2379
    tiup ctl:v6.1.2 pd health -u http://127.0.0.1:2379
    如果超过半数的话,考虑直接scale-out 新节点即可

如果显示只剩下一个正常的,
我感觉需要 pd-recover 这种工具 https://docs.pingcap.com/zh/tidb/stable/pd-recover
感觉复杂度有点高

还是升个版本

分享的内容有点散,现在 PD 的节点,有没有正常的?

如果有正常的,先缩容掉 有问题的节点,在扩就好了,没那么复杂