TIDB3.0.13 升级到TIDB4.0遇到label name 'host' is not specified in pd config (replication.location-labels: [])

TIDB3.0.13 升级到TIDB4.0遇到label name ‘host’ is not specified in pd config (replication.location-labels: [])

1.麻烦反馈下 tiup --versiontiup cluster --version 的结果;
2.从集群拓扑中看 tikv 是单机双实例部署,麻烦确认下有无给 tikv 打 label 。

%E5%9B%BE%E7%89%87

上面说的第二条也麻烦再检查下,如果没有打 label 的话,可以参考下面这个文档处理下:
https://docs.pingcap.com/zh/tidb/stable/schedule-replicas-by-topology-labels#设置-tikv-的-labels-配置

增加了,怎么这样?

采用tiup cluster edit-config test-cluster 修改的,变成

pd 重启完成后,location-labels 不能通过 edit config 的方式修改,需要使用 pd-ctl工具,命令如下:

pd-ctl config set location-labels zone,rack,host

文档:
https://docs.pingcap.com/zh/tidb/stable/schedule-replicas-by-topology-labels

这样怎么操作

试试交互模式吧。。。

./pd-ctl -i -u http://127.0.0.1:2379

然后

config show replication

可以看到 pd 中 replication 相关配置

config set   location-labels zone,rack,host

配置

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。