diff --git a/tools/tikv-control.md b/tools/tikv-control.md index d1dfefc5cee26..ea13d7cafb0aa 100644 --- a/tools/tikv-control.md +++ b/tools/tikv-control.md @@ -179,3 +179,22 @@ If the command is successfully executed, it prints the above information. If the ```bash $ tikv-ctl --host 127.0.0.1:20160 region-properties -r 2 ``` + +### Modify the RocksDB configuration of TiKV dynamically + +You can use the `modify-tikv-config` command to dynamically modify the configuration arguments. Currently, it only supports dynamically modifying RocksDB related arguments. + +- `-m` is used to specify the target RocksDB. You can set it to `kvdb` or `raftdb`. +- `-n` is used to specify the configuration name. + You can refer to the arguments of `[rocksdb]` and `[raftdb]` (corresponding to `kvdb` and `raftdb`) in the [TiKV configuration template](https://github.com/pingcap/tikv/blob/master/etc/config-template.toml#L213-L500). + You can use `default|write|lock + . + argument name` to specify the configuration of different CFs. For `kvdb`, you can set it to `default`, `write`, or `lock`; for `raftdb`, you can only set it to `default`. +- `-v` is used to specify the configuration value. + +```bash +$ tikv-ctl modify-tikv-config -m kvdb -n max_background_jobs -v 8 +success! +$ tikv-ctl modify-tikv-config -m kvdb -n write.block-cache-size -v 256MB +success! +$ tikv-ctl modify-tikv-config -m raftdb -n default.disable_auto_compactions -v true +success! +```