TiDB5.4扩缩容

现有环境

参考

TiDB5.4分布式安装部署(一)_小青蛙呱呱跳的博客-CSDN博客

一、扩容

增加192.168.31.27服务器,部署tikb,tidb,pd

1、准备配置文件

vim scale-out.yaml

内容如下:

tidb_servers:
  - host: 192.168.31.27
    ssh_port: 22
    port: 4000
    status_port: 10080
    deploy_dir: /data/deploy/install/deploy/tidb-4000
    log_dir: /data/deploy/install/log/tidb-4000
tikv_servers:
  - host: 192.168.31.27
    ssh_port: 22
    port: 20160
    status_port: 20180
    deploy_dir: /data/deploy/install/deploy/tikv-20160
    data_dir: /data/deploy/install/data/tikv-20160
    log_dir: /data/deploy/install/log/tikv-20160
pd_servers:
  - host: 192.168.31.27
    ssh_port: 22
    name: pd-1
    client_port: 2379
    peer_port: 2380
    deploy_dir: /data/deploy/install/deploy/pd-2379
    data_dir: /data/deploy/install/data/pd-2379
    log_dir: /data/deploy/install/log/pd-2379

 2、检测27服务器环境

tiup cluster check tidb-test scale-out.yaml --cluster --user root

 不能出现fail

参考:TiDB常见的问题_小青蛙呱呱跳的博客-CSDN博客

3、执行扩容

tiup cluster scale-out tidb-test scale-out.yaml

 4、检查集群状态

1、通过 TiUP

tiup cluster display tidb-test

  

2、通过 TiDB Dashboard  

通过 {pd-ip}:{pd-port}/dashboard 登录 TiDB Dashboard,登录用户和口令为 TiDB 数据库 root 用户和口令

例如:http://192.168.31.112:2379/dashboard

二、缩容

缩容 TiDB/PD/TiKV 节点

#缩容tikv
tiup cluster scale-in tidb-test --node 192.168.31.196:20160
#缩容tidb
tiup cluster scale-in tidb-test --node 192.168.31.196:4000
#缩容pd
tiup cluster scale-in tidb-test --node 192.168.31.196:2379

 结果

tiup cluster display tidb-test

 

 执行,彻底删除

tiup cluster prune tidb-test

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值