3.1.2 TiDB Cluster Operation@1班+Ryan

课程名称:课程版本(101/201/301)+ 3.1.2 TiDB Cluster Operation

学习时长:30min

课程收获:tiup维护tidb集群

课程内容:

检查集群状态
启动停止集群
改变集群配置
扩容集群
集群控制
tidb3.0升级高版本

tiup tidb4.0新的部署管理组件 支持本地,集群部署,组件版本更新 可以理解为tidb生态中的apt
tiup cluster list
tiup cluster display xxx
tiup cluster start/stop xxx [-R role]|[-N node1,node2]
组件启动顺序:pd->tikv->pump->tidb->tiflash->drainer
组件关闭顺序:pd<-tikv<-pump<-tidb<-tiflash<-drainer
tiup cluster edit-config xxx ->global --server configs |specific node --config
tiup cluster reload xxx [-N node] [-R roles]

tiup cluster scale-out xxx scale-out-tidb/tiflash.yaml
tiup cluster scale-in xxx --node node-id
scale in tiflash node->alter table db.table set tiflash replica 0;select * from i_s.tiflash_replica where db_name=db and table_name=table
tiup cluster display xxx然后tiup cluster scale-in xxx --node node-id

tiup集成了tidb-ctl tikv-ctl pd-ctl
tiup ctl [tidb/pd/tikv/binlog/etcd]
tiup ctl pd -u http://127.0.0.1:2379 store = pd-ctl -u http://127.0.0.1:2379 store
fix pack installation–get hotfix patch补丁升级
tiup cluster patch xxx package-path flags----[-R][-N]
3.0/3.1升级
安装tiup
curl --proto ‘=https’ --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh|sh
source .bash_profile
which tiup
tiup cluster
导入tidb ansible—tiup cluster import -d /home/tidb/tidb-ansible
tiup cluster upgrade xxx v4.0.0
tiup cluster exec xxx --command=‘ls /tmp’
tiup cluster audit audit-id
tiup cluster rename xxx yyy
tiup cluster clean xxx --all

学习过程中遇到的问题或延伸思考:

  • 问题 1:
  • 问题 2:
  • 延伸思考 1:
  • 延伸思考 2:

学习过程中参考的其他资料