tikv节点下线缩容后改造成tidb节点记录

栏目: 数据库 · 发布时间: 7年前

内容简介:缩容这个tikv节点,ip地址:172.168.8.112通过命令/data0/tidb-ansible/resources/bin/pd-ctl -u从集群中移除这个节点,/data0/tidb-ansible/resources/bin/pd-ctl -u http://172.168.8.63:2379 -d store delete 11,执行返回SUCCESS成功状态

缩容这个tikv节点,ip地址:172.168.8.112

通过命令/data0/tidb-ansible/resources/bin/pd-ctl -u http://172.168.8.63:2379 -d store 找到对应ip的store id

{

"store": {

"id": 11,

"address": "172.168.8.112:20160",

"state_name": "Up"

},

"status": {

"capacity": "2.0 TiB",

"available": "1.9 TiB",

"leader_count": 656,

"leader_weight": 1,

"leader_score": 67388,

"leader_size": 67388,

"region_count": 1977,

"region_weight": 1,

"region_score": 203287,

"region_size": 203287,

"start_ts": "2018-08-09T17:39:17+08:00",

"last_heartbeat_ts": "2018-08-14T14:29:01.870548044+08:00",

"uptime": "116h49m44.870548044s"

}

},

从集群中移除这个节点,/data0/tidb-ansible/resources/bin/pd-ctl -u http://172.168.8.63:2379 -d store delete 11,执行返回SUCCESS成功状态

再次检查, /data0/tidb-ansible/resources/bin/pd-ctl -u http://172.168.8.63:2379 -d store 11,检查状态为 "state_name": "Offline",此时处于下线中的状态,等过一会变成了"state_name": "Tombstone",就表示完全下线成功了,而在此过程中,最好保持不做任何物理上的删除清理操作。

等完全下线成功后,停止 node11 上的服务:ansible-playbook stop.yml -l 172.168.8.112

编辑 inventory.ini 文件,移除节点信息: 172.168.8.112

更新 Prometheus 配置并重启:ansible-playbook rolling_update_monitor.yml --tags=prometheus

在inventory.ini,添加新的tidb节点 172.168.8.112

  1. 初始化新增节点:

    ansible-playbook bootstrap.yml -l 172.20.101.18,172.20.101.29
  2. 部署新增节点:

    ansible-playbook deploy.yml -l 172.20.101.18,172.20.101.29
  3. 启动新节点服务:

    ansible-playbook start.yml -l 172.20.101.18,172.20.101.29
  4. 更新 Prometheus 配置并重启:

    ansible-playbook rolling_update_monitor.yml --tags=prometheus
  5. 然后再负载均衡里面,添加上这些新的tidb节点


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Shallows

The Shallows

Nicholas Carr / W. W. Norton & Company / 2010-6-15 / USD 26.95

"Is Google making us stupid?" When Nicholas Carr posed that question, in a celebrated Atlantic Monthly cover story, he tapped into a well of anxiety about how the Internet is changing us. He also crys......一起来看看 《The Shallows》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具