开启 placement rules,通过 pd-ctl 调整 max-replicas 问题

你好,

参数是及时生效的,

  1. 可以通过 pd-ctl 查看下
  2. pd.log 日志中也是存在类似的记录
  3. 监控 pd - cluster - pd scheduler config 进行查看

如果开启 enable-placement-rules: true 请按照文档操作进行修改,将 count 设置为 2,location_labels 那个按实际情况改一下,譬如我目前只为 host:

{
  "group_id": "pd",
  "id": "default",
  "start_key": "",
  "end_key": "",
  "role": "voter",
  "count": 2,
  "location_labels": ["host"]
}

执行以下命令生效:
curl -X POST -H "Content-Type: application/json" -data '{rule}' https://ip:port/pd/api/v1/config/rules

详情请看文档操作
https://pingcap.com/docs-cn/stable/how-to/configure/placement-rules/