三副本修改为五副本,未自动补齐五副本

环境:tidb-4.0.10
问题:config set max-replicas 5将副本数从三副本,修改为五副本。pd未自动补齐为五副本


架构:

版本:

MySQL [(none)]> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.10
Edition: Community
Git Commit Hash: dbade8cda4c5a329037746e171449e0a1dfdb8b3
Git Branch: heads/refs/tags/v4.0.10
UTC Build Time: 2021-01-15 02:59:27
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)

MySQL [(none)]>

操作步骤按照下面文档操作

pd config show

» config show
{
  "replication": {
    "enable-placement-rules": "true",
    "location-labels": "zone,rack,host",
    "max-replicas": 5,
    "strictly-match-label": "false"
  },
  "schedule": {
    "enable-cross-table-merge": "false",
    "enable-debug-metrics": "false",
    "enable-location-replacement": "true",
    "enable-make-up-replica": "true",
    "enable-one-way-merge": "false",
    "enable-remove-down-replica": "true",
    "enable-remove-extra-replica": "true",
    "enable-replace-offline-replica": "true",
    "high-space-ratio": 0.7,
    "hot-region-cache-hits-threshold": 3,
    "hot-region-schedule-limit": 4,
    "leader-schedule-limit": 4,
    "leader-schedule-policy": "count",
    "low-space-ratio": 0.8,
    "max-merge-region-keys": 200000,
    "max-merge-region-size": 20,
    "max-pending-peer-count": 16,
    "max-snapshot-count": 3,
    "max-store-down-time": "30m0s",
    "merge-schedule-limit": 8,
    "patrol-region-interval": "100ms",
    "region-schedule-limit": 2048,
    "replica-schedule-limit": 64,
    "scheduler-max-waiting-operator": 5,
    "split-merge-interval": "1h0m0s",
    "store-limit-mode": "manual",
    "tolerant-size-ratio": 20
  }
}
»


开启 Placement Rules 后,原先的 max-replicaslocation-labels 配置项将不再生效。如果需要调整副本策略,应当使用 Placement Rules 相关接口。
https://docs.pingcap.com/zh/tidb/stable/configure-placement-rules#开启-placement-rules-特性

谢谢,增加了规则。已经开始补副本了。
另外问一下,这里面的default rule,需要删除吗,还是放着不用管就行了

  {
    "group_id": "pd",
    "id": "default",
    "start_key": "",
    "end_key": "",
    "role": "voter",
    "count": 3
  }
[root@xx.xx.xx.xx yamlfile]# pd-ctl -u http://xx.xx.xx.xx:2379 config placement-rules show
[
  {
    "group_id": "pd",
    "id": "default",
    "start_key": "",
    "end_key": "",
    "role": "voter",
    "count": 3
  },
  {
    "group_id": "pd",
    "id": "hz",
    "start_key": "",
    "end_key": "",
    "role": "follower",
    "count": 1,
    "label_constraints": [
      {
        "key": "zone",
        "op": "in",
        "values": [
          "hz"
        ]
      }
    ],
    "location_labels": [
      "rack",
      "host"
    ]
  },
  {
    "group_id": "pd",
    "id": "wg",
    "start_key": "",
    "end_key": "",
    "role": "voter",
    "count": 2,
    "label_constraints": [
      {
        "key": "zone",
        "op": "in",
        "values": [
          "wg"
        ]
      }
    ],
    "location_labels": [
      "rack",
      "host"
    ]
  },
  {
    "group_id": "pd",
    "id": "zp",
    "start_key": "",
    "end_key": "",
    "role": "voter",
    "count": 2,
    "label_constraints": [
      {
        "key": "zone",
        "op": "in",
        "values": [
          "zp"
        ]
      }
    ],
    "location_labels": [
      "rack",
      "host"
    ]
  }
]

[root@xx.xx.xx.xx yamlfile]#

嗯,默认的不影响,可以忽略

好的 ,谢谢了

:handshake::handshake::handshake:

如果有其他的问题,欢迎开新帖哈 ~

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