From 19e4ca8b58dac0ad4e60ec4534715b5c9d0b246f Mon Sep 17 00:00:00 2001 From: CaitinChen Date: Mon, 16 Jul 2018 15:47:25 +0800 Subject: [PATCH 1/2] tools: add dynamically modifying RocksDB configuration --- tools/tikv-control.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/tikv-control.md b/tools/tikv-control.md index d1dfefc5cee26..808ab5a760868 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 + +The `modify-tikv-config` command is used 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! +``` \ No newline at end of file From 29f2bbd34cbf3a96d68df638585d82db79a55357 Mon Sep 17 00:00:00 2001 From: Caitin <34535727+CaitinChen@users.noreply.github.com> Date: Thu, 19 Jul 2018 17:24:17 +0800 Subject: [PATCH 2/2] Update wording --- tools/tikv-control.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tikv-control.md b/tools/tikv-control.md index 808ab5a760868..ea13d7cafb0aa 100644 --- a/tools/tikv-control.md +++ b/tools/tikv-control.md @@ -182,7 +182,7 @@ If the command is successfully executed, it prints the above information. If the ### Modify the RocksDB configuration of TiKV dynamically -The `modify-tikv-config` command is used to dynamically modify the configuration arguments. Currently it only supports dynamically modifying RocksDB related arguments. +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. @@ -197,4 +197,4 @@ $ 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! -``` \ No newline at end of file +```