-
Notifications
You must be signed in to change notification settings - Fork 1.2k
add geographic-redundancy-deploy-topology.md #3283
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
sre-bot
merged 19 commits into
pingcap:docs-special-week
from
superlzs0476:lizhongshu-patch-10
May 26, 2020
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
28b2506
add geographic-redundancy-deploy-topology.md
ba0e0ae
Update geo-distributed-deployment-topology.md
superlzs0476 2b0d046
refine format
TomShawn 5c761a5
Update geo-distributed-deployment-topology.md
superlzs0476 b3177ad
Update geo-distributed-deployment-topology.md
superlzs0476 b4dde93
Update geo-distributed-deployment-topology.md
superlzs0476 405e259
Update geo-distributed-deployment-topology.md
superlzs0476 f52fc13
update geographic-redundancy-deploy-topology.md
5b616ef
Update geo-distributed-deployment-topology.md
kissmydb cd1002b
Update geo-distributed-deployment-topology.md
kissmydb 1c2688b
Update geo-distributed-deployment-topology.md
kissmydb 2c87da1
Merge branch 'docs-special-week' into lizhongshu-patch-10
TomShawn e0059f3
Update geo-distributed-deployment-topology.md
TomShawn 3047753
Update geo-distributed-deployment-topology.md
kissmydb 3829417
Merge branch 'docs-special-week' into lizhongshu-patch-10
kissmydb d4fcce4
Merge branch 'docs-special-week' into lizhongshu-patch-10
kissmydb 8b3429f
change <br> to <br/>
TomShawn c44ed78
Merge branch 'docs-special-week' into lizhongshu-patch-10
kissmydb 5a08168
Merge branch 'docs-special-week' into lizhongshu-patch-10
sre-bot 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| --- | ||
| title: 跨数据中心部署拓扑 | ||
| summary: 介绍跨数据中心部署 TiDB 集群的拓扑结构。 | ||
| category: how-to | ||
| --- | ||
|
|
||
| # 跨数据中心部署拓扑 | ||
|
|
||
| 本文以典型的两地三中心为例,介绍跨数据中心部署的拓扑以及关键参数。 | ||
|
|
||
| ## 拓扑信息 | ||
|
|
||
| |实例 | 个数 | 物理机配置 | BJ IP | SH IP |配置 | | ||
| | :-- | :-- | :-- | :-- | :-- | :-- | | ||
| | TiDB |3 | 16 VCore 32GB * 1 | 10.0.1.1 <br/> 10.0.1.2 <br/> 10.0.1.3 <br/> 10.0.1.4 | 10.0.1.5 | 默认端口 <br/> 全局目录配置 | | ||
| | PD | 3 | 4 VCore 8GB * 1 |10.0.1.6 <br/> 10.0.1.7 <br/> 10.0.1.8 <br/> 10.0.1.9 | 10.0.1.10 | 默认端口 <br/> 全局目录配置 | | ||
| | TiKV | 3 | 16 VCore 32GB 2TB (nvme ssd) * 1 | 10.0.1.11 <br/> 10.0.1.12 <br/> 10.0.1.13 <br/> 10.0.1.14 | 10.0.1.15 | 默认端口 <br/> 全局目录配置 | | ||
| | Monitoring & Grafana | 1 | 4 VCore 8GB * 1 500GB (ssd) | 10.0.1.16 || 默认端口 <br/> 全局目录配置 | | ||
|
|
||
| ## 通过 TiUP 部署集群的配置文件模版 topology.yaml | ||
|
|
||
| ### 部署目标 | ||
|
|
||
| 通过 `tidb` 用户管理集群,部署一套跨数据中心的两地三中心拓扑的集群,端口默认,部署目录为 `/tidb-deploy`,数据目录为 `/tidb-data`。 | ||
|
|
||
| ### 拓扑模版 | ||
|
|
||
| [跨机房配置模板](/config-templates/geo-redundancy-deployment.yaml) | ||
|
|
||
| ### 关键参数配置 | ||
|
|
||
| 本节介绍跨数据中心部署 TiDB 集群的关键参数配置。 | ||
|
|
||
| #### TiKV 参数 | ||
|
|
||
| - 设置 gRPC 的压缩格式,默认为 `none`。为提高跨机房部署场景的目标节点间 gRPC 包的传输速度,建议设置为 gzip 格式。 | ||
|
|
||
| ```yaml | ||
| server.grpc-compression-type: gzip | ||
| ``` | ||
|
|
||
| - label 配置 | ||
|
|
||
| 由于采用跨机房部署 TiKV,为了避免物理机宕机导致 Region Group 默认的 5 副本中丢失 3 副本,使集群不可用的问题,可以通过 label 来实现 PD 智能调度,保证同中心、同机柜、同机器 TiKV 实例不会出现 Region Group 有 3 副本的情况。 | ||
|
|
||
| - TiKV 配置 | ||
|
|
||
| 相同物理机配置相同的 host 级别 label 信息: | ||
|
|
||
| ```yaml | ||
| config: | ||
| server.labels: | ||
| zone: bj | ||
| dc: bja | ||
| rack: rack1 | ||
| host: host2 | ||
| ``` | ||
|
|
||
| - 防止异地 TiKV 节点发起不必要的 Raft 选举,需要将异地 TiKV 节点发起选举时经过最少的 tick 个数和最多经过的 tick 个数都调大,这两个参数默认设置均为 `0`。 | ||
|
|
||
| ```yaml | ||
| raftstore.raft-min-election-timeout-ticks: 1000 | ||
| raftstore.raft-max-election-timeout-ticks: 1020 | ||
| ``` | ||
|
|
||
| #### PD 参数 | ||
|
|
||
| - PD 元数据信息记录 TiKV 集群的拓扑信息,根据四个维度调度 Raft Group 副本。 | ||
|
|
||
| ```yaml | ||
| replication.location-labels: ["zone","dc","rack","host"] | ||
| ``` | ||
|
|
||
| - 调整 Raft Group 的副本数据量为 5 ,保证集群的高可用性。 | ||
|
|
||
| ```yaml | ||
| replication.max-replicas: 5 | ||
| ``` | ||
|
|
||
| - 拒绝异地机房 TiKV 的 Raft 副本拒绝选举为 leader。 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed with author: |
||
|
|
||
| ```yaml | ||
| label-property: | ||
| reject-leader: | ||
| - key: "dc" | ||
| value: "sha" | ||
| ``` | ||
|
|
||
| > **注意:** | ||
| > | ||
| > 无需手动创建配置文件中的 `tidb` 用户,TiUP cluster 组件会在部署主机上自动创建该用户。可以自定义用户,也可以和中控机的用户保持一致。 | ||
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.