Skip to content

Conversation

@disksing
Copy link
Contributor

Signed-off-by: disksing i@disksing.com

What is changed, added or deleted? (Required)

add placement rules configuratoin guide

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)

If you select two or more versions from above, to trigger the bot to cherry-pick this PR to your desired release version branch(es), you must add corresponding labels such as needs-cherry-pick-3.1, needs-cherry-pick-3.0, and needs-cherry-pick-2.1.

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

original PR #2246

  • This PR is translated from:
  • Other reference link(s):

Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
@disksing disksing requested review from IANTHEREAL and TomShawn March 31, 2020 11:58
@TomShawn TomShawn added translation/doing This PR’s assignee is translating this PR. v4.0 This PR/issue applies to TiDB v4.0. labels Mar 31, 2020
disksing and others added 10 commits April 1, 2020 12:54
Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
Signed-off-by: disksing <i@disksing.com>
@TomShawn
Copy link
Contributor

TomShawn commented Apr 1, 2020

LGTM
@GregoryIan PTAL

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
pd-ctl config placement-rules show --group=pd --id=default
```

**查看 Region 2 所匹配的规则列表**
Copy link
Contributor

Choose a reason for hiding this comment

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

region 2 是什么?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo


以上操作会将 rule1、rule2 两条规则写入 PD,如果系统中已经存在 GroupID+ID 相同的规则,则会被覆盖。

如果需要删除某条规则,只需要将规则的 `count` 置为 0 即可,对应 GroupID+ID 相同的规则会被删除。如下命令将删除 pd/rule2 这条规则:
Copy link
Contributor

Choose a reason for hiding this comment

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

能不能直接提供一条 delete 命令

Copy link
Contributor Author

Choose a reason for hiding this comment

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

也行,不过只能删一个,所以这个还是要保留,我觉得

Copy link
Contributor

Choose a reason for hiding this comment

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

好的,晚点可以加一个


> **注意:**
>
> DDL 等操作会导致 table ID 发生变化,需要同步更新对应的规则。
Copy link
Contributor

Choose a reason for hiding this comment

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

这个主意项挺关键的,要不要再命令行提示里面放提醒,真怕用户看不到这行

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tidb-ctl 的输出也有提示

Copy link
Contributor

@IANTHEREAL IANTHEREAL left a comment

Choose a reason for hiding this comment

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

LGTM

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

@TomShawn TomShawn merged commit fa0ef5d into pingcap:master Apr 2, 2020
sre-bot pushed a commit to sre-bot/docs-cn that referenced this pull request Apr 2, 2020
* how-to: add placement rule document

Signed-off-by: disksing <i@disksing.com>

* minor update

Signed-off-by: disksing <i@disksing.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* address comment

Signed-off-by: disksing <i@disksing.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update placement-rules.md

* Update placement-rules.md

* refine format and language

* fix a typo

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: Ian <ArGregoryIan@gmail.com>
Co-authored-by: TomShawn <1135243111@qq.com>
@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2020

cherry pick to release-3.1 in PR #2610

TomShawn added a commit that referenced this pull request Apr 2, 2020
* how-to: add placement rule document

Signed-off-by: disksing <i@disksing.com>

* minor update

Signed-off-by: disksing <i@disksing.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* address comment

Signed-off-by: disksing <i@disksing.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update placement-rules.md

* Update placement-rules.md

* refine format and language

* fix a typo

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: Ian <ArGregoryIan@gmail.com>
Co-authored-by: TomShawn <1135243111@qq.com>

Co-authored-by: disksing <i@disksing.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: Ian <ArGregoryIan@gmail.com>
Co-authored-by: TomShawn <1135243111@qq.com>
@TomShawn TomShawn assigned TomShawn and unassigned ran-huang Apr 3, 2020
@disksing disksing deleted the placement-rules branch April 3, 2020 03:09
@TomShawn TomShawn 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 Apr 4, 2020
rleungx pushed a commit to rleungx/docs-cn that referenced this pull request May 22, 2020
* how-to: add placement rule document

Signed-off-by: disksing <i@disksing.com>

* minor update

Signed-off-by: disksing <i@disksing.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* address comment

Signed-off-by: disksing <i@disksing.com>

* Update how-to/configure/placement-rules.md

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Update placement-rules.md

* Update placement-rules.md

* refine format and language

* fix a typo

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: Ian <ArGregoryIan@gmail.com>
Co-authored-by: TomShawn <1135243111@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants