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

op-guide: update location-awareness.md #824

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions op-guide/location-awareness.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ location-labels = ["zone", "rack", "host"]

PD 能够根据我们提供的拓扑信息作出最优的调度,我们只需要关心什么样的拓扑结构能够达到我们想要的效果。

假设我们使用三副本,并且希望一个数据中心挂掉的情况下能够正常服务,我们至少需要四个数据中心
(理论上三个数据中心即可,但是当前实现无法保证)。
假设我们使用三副本,并且希望一个数据中心挂掉的情况下,还能继续保持 TiDB 集群的高可用状态,我们至少需要四个数据中心。

假设我们有四个数据中心 (zone),每个数据中心有两个机架 (rack),每个机架上有两个主机 (host)。
每个主机上面启动一个 TiKV 实例:
Expand Down Expand Up @@ -81,7 +80,7 @@ tikv-server --labels zone=z4,rack=r2,host=h2
也就是说,我们有 16 个 TiKV 实例,分布在 4 个不同的数据中心,8 个不同的机架,16 个不同的机器。

在这种拓扑结构下,PD 会优先把每一份数据的不同副本调度到不同的数据中心。
这时候如果其中一个数据中心挂了,不会影响正常服务
这时候如果其中一个数据中心挂了,不会影响 TiDB 集群的高可用状态
如果这个数据中心一段时间内恢复不了,PD 会把这个数据中心的副本迁移出去。

总的来说,PD 能够根据当前的拓扑结构使得集群容灾能力最大化,所以如果我们希望达到某个级别的容灾能力,
Expand Down