-
Notifications
You must be signed in to change notification settings - Fork 1.2k
reference: add PD scheduling best practice #1990
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
65f0130
add PD best practice
3ec61d7
fix lint and links
5bff0bc
fix link format
8b1e1c4
fix lint
df4f046
minor wording and formatting fixes
edb02c6
Merge branch 'master' into pd-best-practice
lilin90 d60e3e5
Apply suggestions from from Lilian
87aa2f9
apply changes to 2.1 and 3.0
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| --- | ||
| title: 术语表 | ||
| summary: 学习 TiDB 相关术语 | ||
| category: glossary | ||
| --- | ||
|
|
||
| # 术语表 | ||
|
|
||
| ## L | ||
|
|
||
| ### Leader/Follower/Learner | ||
|
|
||
| 它们分别对应 [Peer](#regionpeerraft-group) 的三种角色。其中 Leader 负责响应客户端的读写请求;Follower 被动地从 Leader 同步数据,当 Leader 失效时会进行选举产生新的 Leader;Learner 是一种特殊的角色,它只参与同步 raft log 而不参与投票,在目前的实现中只短暂存在于添加副本的中间步骤。 | ||
|
|
||
| ## O | ||
|
|
||
| ### Operator | ||
|
|
||
| Operator 是应用于一个 Region 的,服务于某个调度目的的一系列操作的集合。例如“将 Region 2 的 Leader 迁移至 Store 5”,“将 Region 2 的副本迁移到 Store 1, 4, 5”等。 | ||
|
|
||
| Operator 可以是由 Scheduler 通过计算生成的,也可以是由外部 API 创建的。 | ||
|
|
||
| ### Operator Step | ||
|
|
||
| Operator Step 是 Operator 执行过程的一个步骤,一个 Operator 常常会包含多个 Operator Step。 | ||
|
|
||
| 目前 PD 可生成的 Step 包括: | ||
|
|
||
| - `TransferLeader`:将 Region Leader 迁移至指定 Peer | ||
| - `AddPeer`:在指定 Store 添加 Follower | ||
| - `RemovePeer`:删除一个 Region Peer | ||
| - `AddLearner`:在指定 Store 添加 Region Learner | ||
| - `PromoteLearner`:将指定 Learner 提升为 Follower | ||
| - `SplitRegion`:将指定 Region 一分为二 | ||
|
|
||
| ## P | ||
|
|
||
| ### Pending/Down | ||
|
|
||
| Pending 和 Down 是 Peer 可能出现的两种特殊状态。其中 Pending 表示 Follower 或 Learner 的 raft log 与 Leader 有较大差距,Pending 状态的 Follower 无法被选举成 Leader。Down 是指 Leader 长时间没有收到对应 Peer 的消息,通常意味着对应节点发生了宕机或者网络隔离。 | ||
|
|
||
| ## R | ||
|
|
||
| ### Region/Peer/Raft Group | ||
|
|
||
| 每个 Region 负责维护集群的一段连续数据(默认配置下平均约 96 MiB),每份数据会在不同的 Store 存储多个副本(默认配置是 3 副本),每个副本称为 Peer。同一个 Region 的多个 Peer 通过 raft 协议进行数据同步,所以 Peer 也用来指代 raft 实例中的成员。TiKV 使用 multi-raft 模式来管理数据,即每个 Region 都对应一个独立运行的 raft 实例,我们也把这样的一个 raft 实例叫做一个 Raft Group。 | ||
|
|
||
| ### Region Split | ||
|
|
||
| TiKV 集群中的 Region 不是一开始就划分好的,而是随着数据写入逐渐分裂生成的,分裂的过程被称为 Region Split。 | ||
|
|
||
| 其机制是集群初始化时构建一个初始 Region 覆盖整个 key space,随后在运行过程中每当 Region 数据达到一定量之后就通过 Split 产生新的 Region。 | ||
|
|
||
| ## S | ||
|
|
||
| ### Scheduler | ||
|
|
||
| Scheduler(调度器)是 PD 中生成调度的组件。PD 中每个调度器是独立运行的,分别服务于不同的调度目的。常用的调度器及其调用目标有: | ||
|
|
||
| - `balance-leader-scheduler`:保持不同节点的 Leader 均衡。 | ||
| - `balance-region-scheduler`:保持不同节点的 Peer 均衡。 | ||
| - `hot-region-scheduler`:保持不同节点的读写热点 Region 均衡。 | ||
| - `evict-leader-{store-id}`:驱逐某个节点的所有 Leader。(常用于滚动升级) | ||
|
|
||
| ### Store | ||
|
|
||
| PD 中的 Store 指的是集群中的存储节点,也就是 tikv-server 实例。Store 与 TiKV 实例是严格一一对应的,即使在同一主机甚至同一块磁盘部署多个 TiKV 实例,这些实例也对会对应不同的 Store。 | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| --- | ||
| title: 术语表 | ||
| summary: 学习 TiDB 相关术语 | ||
| category: glossary | ||
| --- | ||
|
|
||
| # 术语表 | ||
|
|
||
| ## L | ||
|
|
||
| ### Leader/Follower/Learner | ||
|
|
||
| 它们分别对应 [Peer](#regionpeerraft-group) 的三种角色。其中 Leader 负责响应客户端的读写请求;Follower 被动地从 Leader 同步数据,当 Leader 失效时会进行选举产生新的 Leader;Learner 是一种特殊的角色,它只参与同步 raft log 而不参与投票,在目前的实现中只短暂存在于添加副本的中间步骤。 | ||
|
|
||
| ## O | ||
|
|
||
| ### Operator | ||
|
|
||
| Operator 是应用于一个 Region 的,服务于某个调度目的的一系列操作的集合。例如“将 Region 2 的 Leader 迁移至 Store 5”,“将 Region 2 的副本迁移到 Store 1, 4, 5”等。 | ||
|
|
||
| Operator 可以是由 Scheduler 通过计算生成的,也可以是由外部 API 创建的。 | ||
|
|
||
| ### Operator Step | ||
|
|
||
| Operator Step 是 Operator 执行过程的一个步骤,一个 Operator 常常会包含多个 Operator Step。 | ||
|
|
||
| 目前 PD 可生成的 Step 包括: | ||
|
|
||
| - `TransferLeader`:将 Region Leader 迁移至指定 Peer | ||
| - `AddPeer`:在指定 Store 添加 Follower | ||
| - `RemovePeer`:删除一个 Region Peer | ||
| - `AddLearner`:在指定 Store 添加 Region Learner | ||
| - `PromoteLearner`:将指定 Learner 提升为 Follower | ||
| - `SplitRegion`:将指定 Region 一分为二 | ||
|
|
||
| ## P | ||
|
|
||
| ### Pending/Down | ||
|
|
||
| Pending 和 Down 是 Peer 可能出现的两种特殊状态。其中 Pending 表示 Follower 或 Learner 的 raft log 与 Leader 有较大差距,Pending 状态的 Follower 无法被选举成 Leader。Down 是指 Leader 长时间没有收到对应 Peer 的消息,通常意味着对应节点发生了宕机或者网络隔离。 | ||
|
|
||
| ## R | ||
|
|
||
| ### Region/Peer/Raft Group | ||
|
|
||
| 每个 Region 负责维护集群的一段连续数据(默认配置下平均约 96 MiB),每份数据会在不同的 Store 存储多个副本(默认配置是 3 副本),每个副本称为 Peer。同一个 Region 的多个 Peer 通过 raft 协议进行数据同步,所以 Peer 也用来指代 raft 实例中的成员。TiKV 使用 multi-raft 模式来管理数据,即每个 Region 都对应一个独立运行的 raft 实例,我们也把这样的一个 raft 实例叫做一个 Raft Group。 | ||
|
|
||
| ### Region Split | ||
|
|
||
| TiKV 集群中的 Region 不是一开始就划分好的,而是随着数据写入逐渐分裂生成的,分裂的过程被称为 Region Split。 | ||
|
|
||
| 其机制是集群初始化时构建一个初始 Region 覆盖整个 key space,随后在运行过程中每当 Region 数据达到一定量之后就通过 Split 产生新的 Region。 | ||
|
|
||
| ## S | ||
|
|
||
| ### Scheduler | ||
|
|
||
| Scheduler(调度器)是 PD 中生成调度的组件。PD 中每个调度器是独立运行的,分别服务于不同的调度目的。常用的调度器及其调用目标有: | ||
|
|
||
| - `balance-leader-scheduler`:保持不同节点的 Leader 均衡。 | ||
| - `balance-region-scheduler`:保持不同节点的 Peer 均衡。 | ||
| - `hot-region-scheduler`:保持不同节点的读写热点 Region 均衡。 | ||
| - `evict-leader-{store-id}`:驱逐某个节点的所有 Leader。(常用于滚动升级) | ||
|
|
||
| ### Store | ||
|
|
||
| PD 中的 Store 指的是集群中的存储节点,也就是 tikv-server 实例。Store 与 TiKV 实例是严格一一对应的,即使在同一主机甚至同一块磁盘部署多个 TiKV 实例,这些实例也对会对应不同的 Store。 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.