# `pd-ctl` 基本操作

+ 查看并修改调度参数
  + `config show` - -显示当前调度相关参数
  + `config set <key> <value>` - -修改相关参数
  + `store limit <store_id> <value>` - -限制单个 `store` 的调度速度
  
+ 手动添加 `Operator`
  + `operator show [admin|leader|region]` - -展示当前全局或者是某类的调度任务
  + `operator add` - -人工添加一些调度任务实现期望目标，例如：
    + `operator add add-peer <region_id> <store_id>`
    + `operator add remove-peer <region_id> <store_id>`
    + `operator add transfer-leader <region_id> <store_id>`

-------------------------------------------------------------
pd-ctl 基本操作
- 查看并修改调度参数
  - config show 显示当前调度相关参数
  - config set <key> <value> 修改相关参数
  - store limit <store_id> <value> 限制单个 store 的调度速度
- 手动添加 Operator
  - operator show [admin|leader|region] 展示当前全局或者是某类的调度任务
  - operator add 人工添加一些调度任务实现期望目标，例如
    - operator add add-peer <region_id> <store_id>
    - operator add remove-peer <region_id> <store_id>
    - operator add transfer-leader <region_id> <store_id>
- 如何设置 label
  - label 包含 PD 和 TiKV 两部分设置，PD 通过修改 replication.location-labels 配置，TiKV 通过 store label <store_id> <key> <value> 可以在线修改，但需要同时修改 TiKV 配置文件中对应的 server.labels 参数。
  - 注意
    - TiKV 配置需要跟 PD 配置的层级一致，如果开启 strictly-match-label 参数，当发现这两部分配置不一致，TiKV 启动时会报错。
    - 部署 TiFlash 时会要求开启 enable-placement-rules，这种情况下无法通过 config set 设置 location-labels，max-replicas 参数，需要通过 placement rules 修改
