fu-r
(Fu R)
21
root@localhost data]# tiup update cluster
The component cluster:v0.6.2
has been installed.
Update successfully!
[root@localhost data]# tiup cluster -v
Starting component cluster
: /root/.tiup/components/cluster/v0.6.2/cluster -v
tiup version v0.6.0 (Unknown/Unknown) go1.13
[root@localhost data]# tiup --binary cluster
/root/.tiup/components/cluster/v0.6.2/cluster
[root@localhost data]#
birdstorm
(Birdstorm - PingCAP)
23
哦不好意思看错了,你这里看的是 tiup 的版本信息。能确认一下缩容后的 data_dir 目录是否删除了?
fu-r
(Fu R)
24
tidb-data下面的tiflash-9000目录被删除了
birdstorm
(Birdstorm - PingCAP)
25
你需要看一下你配置在 topo 里的 data_dir 目录是否删除。
fu-r
(Fu R)
26
data_dir里面,除了tiflash-9000,还有其他三个:alertmanager-9093 monitor-9100 prometheus-9090
缩容的时候,确定tiflash-9000已经删除了。
birdstorm
(Birdstorm - PingCAP)
27
好的,感谢提供环境信息。最后,确认一下扩容时的配置信息吧。能否提供一下你的 scale-out.yaml 文件?
目前已知 tiup cluster 有一个问题是 scale-out 时的 global 设置不会生效,但已经在 https://github.com/pingcap-incubator/tiup-cluster/pull/397 修复。解决方法有两种。
- 在 scale-out 时的复制一份 global 配置放在 scale-out.yaml 中。
- 自行编译 tiup-cluster 的 master 版本并替换掉当前使用的 tiup cluster。
fu-r
(Fu R)
28
来了老弟
29
你好,
屡一下思路
- 缩容 tiflash 节点
- 检查 data_dir、deploy_dir 是否存在已经缩容 tiflash 相关目录,如果有则删除
- 将一下内容添加到 scale-out 文件。
global:
user: "tidb"
ssh_port: 22
deploy_dir: "/home/tidb/tidb_cluster/tidb-deploy"
data_dir: "/home/tidb/tidb_cluster/tidb-data"
monitored:
node_exporter_port: 9100
blackbox_exporter_port: 9115
server_configs:
pd:
replication.enable-placement-rules: true
tiflash:
logger.level: "info"
tiflash_servers:
- host: 192.168.0.244
- 扩容该节点,看是否成功,注意保留 tiflash_deploy-dir/log/*,否则上传下所有日志。
辛苦操作下,这边也会持续跟踪这个问题
fu-r
(Fu R)
30
tiflash.log (611.2 KB) tiflash_error.log (162 字节) tiflash_tikv.log (425.1 KB)
还是不行,scale-out的时候,显示是成功的,但查看状态依然是down
birdstorm
(Birdstorm - PingCAP)
31
fu-r
(Fu R)
33
可能是这个原因,我只是执行了缩容命令: tiup cluster scale-in tidb-test --node 192.168.0.244:9000
并没有删除相应的数据文件,请问应该删除哪些数据文件呢?或者是不是需要执行
alter table . set tiflash replica 0;
这命令呢?
birdstorm
(Birdstorm - PingCAP)
34
按照你的 topo 文件来看,只有一个 TiFlash 节点。
在 TiDB 客户端中针对所有副本数大于集群剩余 TiFlash 节点数的表执行
alter table <db-name>.<table-name> set tiflash replica 0;
当此节点被缩容时,需要先将所有的 TiFlash 同步表的 TiFlash 副本删除。
需要注意,必须完成上面这一步才可以进行后续的操作。
针对数据文件而言,需要确认 TiFlash 的 topo 中指定的 data_dir 目录下已经清空。目前的 TiUp scale-in 命令会自动删除数据文件。
在你提供的 tiflash_tikv.log 中,显示
[2020/05/26 12:14:24.709 +08:00] [ERROR] [util.rs:327] [“request failed”] [err="Grpc(RpcFailure(RpcStatus { status: 2-UNKNOWN, details: Some("duplicated store address: id:1511537 address:\“192.168.0.244:3930\” labels:<key:\“engine\” value:\“tiflash\” > version:\“v4.0.0-rc.1\” peer_address:\“192.168.0.244:20170\” status_address:\“192.168.0.244:20292\” git_hash:\“2d30a83ffa9508fd0468a708cdb0579327f788da\” start_timestamp:1590466464 , already registered by id:88 address:\“192.168.0.244:3930\” labels:<key:\“engine\” value:\“tiflash\” > version:\“4.0.0-beta\” peer_address:\“192.168.0.244:20170\” last_heartbeat:1589959954398864587 “) }))”]
表示在 pd 中该 TiFlash 节点缩容后并未进入到下线状态,可以参考 https://pingcap.com/docs-cn/stable/tiflash/maintain-tiflash/#下线-tiflash-节点 的第三四步进行操作。
fu-r
(Fu R)
36
谢谢,但是,我的集群里是有另外一个tiflash节点的,就是192.168.0.135:9000,这个节点是正常运行的,如果我执行了“alter table . set tiflash replica 0;“ 那这个正常的节点是不是会受到影响?
另外就是这里: tidb-ansible 目录下的 resources/bin
包含对应的二进制文件) 中输入 store 命令,查看该 TiFlash 节点对应的 store id。
我没有找到tidb-ansible目录啊,怎么办?
birdstorm
(Birdstorm - PingCAP)
37
如果有多个 tiflash 节点,那应该不需要这么操作的,但是从你的拓扑文件看,并不存在这个 192.168.0.135:9000 节点。请问这个节点是如何加入集群的?
另外,可以通过下列命令使用 pd-ctl
tiup ctl pd <command>
如:
tiup ctl pd -u <pd-address> store
fu-r
(Fu R)
38
这个192.168.0.135:9000的tiflash节点,是我执行扩容命令添加的节点,所以在topology.yaml上没有。是在我某个scale-out.yaml文件里,这个tiflash节点正常运行。
birdstorm
(Birdstorm - PingCAP)
39
好的,请先根据上述指南中的下线流程,手动下线 pd 中 TiFlash store,然后再看看。
fu-r
(Fu R)
40
请问,我执行了以下命令:
tiup ctl pd -u 192.168.0.246:2379 store
查到store id是88
然后,我执行命令:
tiup ctl pd store delete 88
[root@localhost /]# tiup ctl pd store delete 88
Starting component ctl
: /root/.tiup/components/ctl/v4.0.0-rc.2/ctl pd store delete 88
Failed to delete store 88: Delete http://127.0.0.1:2379/pd/api/v1/store/88: dial tcp 127.0.0.1:2379:
connect: connection refused
[root@localhost /]#
怎么办呢?是不是我的ctl pd命令错了?
fu-r
(Fu R)
41
我查了pd control的用法,大概知道了,已删除88,谢谢
fu-r
(Fu R)
42
在pd control的交互模式中,输入命令store delete 88, 收到回应Success!, 但是再查看,88还是在的,所以还是没有删除,敬请指导!