Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reference/configuration: add a guide about how to use dynamic config #3058

Merged
merged 59 commits into from
Jul 30, 2020

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented May 13, 2020

What is changed, added or deleted? (Required)

This PR adds a guide about how to use the dynamic config.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version, including v4.0 changes for now)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

N/A

@rleungx rleungx added the v4.0 This PR/issue applies to TiDB v4.0. label May 13, 2020
@rleungx rleungx requested review from qw4990 and NingLin-P May 13, 2020 05:23
@rleungx
Copy link
Member Author

rleungx commented May 13, 2020

PTAL @qw4990 @NingLin-P

Copy link
Contributor

@NingLin-P NingLin-P left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

可以通过 SQL `show config` 来直接查看集群所有实例的配置信息,结果如下:

```
mysql> mysql> show config;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mysql> mysql> show config;
mysql> show config;

+---------+------+---------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------------------------------------------------------------------------------+
| Warning | 1105 | bad request to http://127.0.0.1:20180/config: fail to update, error: "config \"log_level\" can not be change" |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Warning | 1105 | bad request to http://127.0.0.1:20180/config: fail to update, error: "config \"log_level\" can not be change" |
| Warning | 1105 | bad request to http://127.0.0.1:20180/config: fail to update, error: "config log-level can not be change" |

tikv/tikv#7795 had been updated the error format.

@ran-huang ran-huang self-requested a review May 13, 2020 10:32
@ran-huang
Copy link
Contributor

@rleungx Do these changes apply to v4.0?

reference/configuration/dynamic-config.md Outdated Show resolved Hide resolved
Comment on lines 71 to 73
使用 `set config` 时,需要注意:
为了避免和 SQL 变量混淆,TiDB 的配置可以通过 `show config` 查看但是不能进行修改,修改 TiDB 动态配置是会返回错误,如果想动态修改 TiDB 行为,请用对应的 SQL 变量去控制;
某些配置项名称可能和 TiDB 预留关键字冲突,如 `limit`,`key` 等,对于此类配置项,需要用反引号 \` 包裹起来,如 `tikv-client`.`store-limit`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
使用 `set config` 时,需要注意:
为了避免和 SQL 变量混淆,TiDB 的配置可以通过 `show config` 查看但是不能进行修改,修改 TiDB 动态配置是会返回错误,如果想动态修改 TiDB 行为,请用对应的 SQL 变量去控制
某些配置项名称可能和 TiDB 预留关键字冲突,如 `limit``key` 等,对于此类配置项,需要用反引号 \` 包裹起来,如 `tikv-client`.`store-limit`
> **注意:**
> 为了避免和 SQL 变量混淆,TiDB 的配置可以通过 `show config` 查看但是不能进行修改,修改 TiDB 动态配置时会返回错误;如果想动态修改 TiDB 行为,请用对应的 SQL 变量去控制
> 某些配置项名称可能和 TiDB 预留关键字冲突,如 `limit``key` 等,对于此类配置项,需要用反引号 ``` ` ``` 包裹起来,如 `tikv-client`.`store-limit`

| --- | --- |
| log.level| 日志级别 |
| cluster-version | 集群的版本 |
| schedule.max-merge-region-size | 控制 Region Merge 的 size 上限(单位是 M) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| schedule.max-merge-region-size | 控制 Region Merge 的 size 上限(单位是 M|
| schedule.max-merge-region-size | 控制 Region Merge 的 size 上限(单位是 MB|

Comment on lines 189 to 192
上述前缀为 `{db-name}` 或 `{db-name}.{cf-name}` 的参数是 RocksDB 相关的配置
`db-name` 的取值可以为是 `rocksdb`, `raftdb`
当 `db-name` 为 `rocksdb` 时,cf-name 的取值有: `defaultcf`,`writecf`,`lockcf`,`raftcf`
当 `db-name` 为 `raftdb` 时,cf-name 的取值有: `defaultcf`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
上述前缀为 `{db-name}``{db-name}.{cf-name}` 的参数是 RocksDB 相关的配置
`db-name` 的取值可以为是 `rocksdb`, `raftdb`
`db-name``rocksdb` 时,cf-name 的取值有: `defaultcf``writecf``lockcf``raftcf`
`db-name``raftdb` 时,cf-name 的取值有: `defaultcf`
上述前缀为 `{db-name}``{db-name}.{cf-name}` 的参数是 RocksDB 相关的配置`db-name` 的取值可以为是 `rocksdb`, `raftdb`
- `db-name``rocksdb` 时,cf-name 的取值有: `defaultcf``writecf``lockcf``raftcf`
- `db-name``raftdb` 时,cf-name 的取值有: `defaultcf`

@ran-huang ran-huang added needs-cherry-pick-4.0 translation/doing This PR’s assignee is translating this PR. labels May 13, 2020
@ran-huang ran-huang self-assigned this May 13, 2020
@ran-huang ran-huang added the status/WIP This PR is still working in progress. label May 13, 2020
@TomShawn TomShawn added the size/large Changes of a large size. label May 13, 2020
@TomShawn
Copy link
Contributor

@qw4990 PTAL
@rleungx Please address the comments above.

rleungx added 4 commits May 20, 2020 16:31
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx
Copy link
Member Author

rleungx commented May 20, 2020

@NingLin-P @qw4990 PTAL

dynamic-config.md Outdated Show resolved Hide resolved
Copy link
Contributor

@NingLin-P NingLin-P left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-authored-by: NingLin-P <linning@pingcap.com>
@ran-huang ran-huang removed the status/WIP This PR is still working in progress. label May 20, 2020
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
dynamic-config.md Outdated Show resolved Hide resolved
Copy link
Contributor

@ran-huang ran-huang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

dynamic-config.md Outdated Show resolved Hide resolved
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jul 30, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 30, 2020
Copy link
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Jul 30, 2020
@TomShawn TomShawn added status/can-merge Indicates a PR has been approved by a committer. translation/doing This PR’s assignee is translating this PR. and removed translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. labels Jul 30, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@TomShawn
Copy link
Contributor

@ran-huang Please be aware of the major changes made in this PR since you finished the translation. Please carefully compare and align these changes, thanks!

@TomShawn TomShawn merged commit a0b92ca into pingcap:master Jul 30, 2020
ti-srebot pushed a commit to ti-srebot/docs-cn that referenced this pull request Jul 30, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #4128

ti-srebot added a commit that referenced this pull request Jul 30, 2020
…3058) (#4128)

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
@ran-huang ran-huang added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR’s assignee is translating this PR. labels Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/large Changes of a large size. status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. v4.0 This PR/issue applies to TiDB v4.0.
Projects
None yet
Development

Successfully merging this pull request may close these issues.