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

how-to: add placement rule guide #2171

Merged
merged 7 commits into from
Apr 7, 2020
Merged

Conversation

TomShawn
Copy link
Contributor

@TomShawn TomShawn commented Apr 4, 2020

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)
  • v4.0 (TiDB 4.0 versions)
  • 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-4.0, 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)?

@TomShawn TomShawn added translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. needs-cherry-pick-4.0 labels Apr 4, 2020
@TomShawn TomShawn requested a review from disksing April 4, 2020 05:45
@TomShawn TomShawn requested a review from lilin90 April 7, 2020 03:42

# Placement Rules

Placement Rules is an experimental feature introduced since PD v4.0. It is a replica rule system that guides PD to generate corresponding schedules for different types of data. By combining different scheduling rules, you can finely control the attributes such as the number of replicas of any continuous data range, the storage location, the host type, whether to participate in Raft election, and whether to act as the Raft leader.
Copy link
Contributor

Choose a reason for hiding this comment

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

storage location, host type, 后面这些跟 number of replicas 是并列关系的,都是一种 attribute。这么改行不行?

Suggested change
Placement Rules is an experimental feature introduced since PD v4.0. It is a replica rule system that guides PD to generate corresponding schedules for different types of data. By combining different scheduling rules, you can finely control the attributes such as the number of replicas of any continuous data range, the storage location, the host type, whether to participate in Raft election, and whether to act as the Raft leader.
Placement Rules is an experimental feature introduced since PD v4.0. It is a replica rule system that guides PD to generate corresponding schedules for different types of data. By combining different scheduling rules, you can finely control the attributes of any continuous data range, such as the number of replicas, the storage location, the host type, whether to participate in Raft election, and whether to act as the Raft leader.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,已改。

| `GroupID` | `string` | The group ID that marks the source of the rule. |
| `ID` | `string` | The unique ID of a rule in a group. |
| `Index` | `int` | The stacking sequence of rules in a group. |
| `Override` | `true`/`false` | The smaller rule that determines whether to overwrite index (in a group). |
Copy link
Contributor

Choose a reason for hiding this comment

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

Whether to overwrite rule with smaller index (in a group)

enable-placement-rules = true
```

In this way, PD enables this feature after the cluster is successfully initialized and generates corresponding rules according to the `max-replicas` and `location-labels` configurations:
Copy link
Contributor

Choose a reason for hiding this comment

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

initialized -> bootstrapped

}
```

For a initialized cluster, you can also enable Placement Rules online through pd-ctl:
Copy link
Contributor

Choose a reason for hiding this comment

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

bootstrapped cluster

}
```

### Place five replicas in three data centers in the proportion of two-two-one, and the Leader should not be in the third data center
Copy link
Contributor

Choose a reason for hiding this comment

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

two-two-one -> 2-2-1 or 2:2:1?

Copy link
Member

@lilin90 lilin90 left a comment

Choose a reason for hiding this comment

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

LGTM

@lilin90 lilin90 added the v4.0 This PR/issue applies to TiDB v4.0. label Apr 7, 2020
@lilin90 lilin90 merged commit e93c595 into pingcap:master Apr 7, 2020
sre-bot pushed a commit to sre-bot/docs that referenced this pull request Apr 7, 2020
* how-to: add placement rule guide

* fix typos

* address comments from disksing

* how-to: update wording and format

* how-to: update and fix description

Co-authored-by: Lilian Lee <lilin@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Apr 7, 2020

cherry pick to release-4.0 in PR #2185

lilin90 added a commit that referenced this pull request Apr 7, 2020
* how-to: add placement rule guide

* fix typos

* address comments from disksing

* how-to: update wording and format

* how-to: update and fix description

Co-authored-by: Lilian Lee <lilin@pingcap.com>

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: Lilian Lee <lilin@pingcap.com>
@TomShawn TomShawn deleted the placement-rules branch April 7, 2020 09:35
sre-bot pushed a commit to sre-bot/docs that referenced this pull request Jun 11, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Jun 11, 2020

cherry pick to release-3.1 in PR #2810

TomShawn added a commit that referenced this pull request Jun 16, 2020
* cherry pick #2171 to release-3.1

Signed-off-by: sre-bot <sre-bot@pingcap.com>

* resolve conflict

* Update configure-placement-rules.md

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. 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