Skip to content

multiple AZs in two regions: fix the topology example #13384

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions three-data-centers-in-two-cities-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ AZ1 的 rac1 机架中,一台服务器部署了 TiDB 和 PD 服务,另外两

以下为一个 `tiup topology.yaml` 文件示例:

```
```yaml
# # Global variables are applied to all deployments and used as the default value of
# # the deployments if a specific deployment value is missing.
global:
Expand All @@ -76,7 +76,7 @@ server_configs:
tikv:
server.grpc-compression-type: gzip
pd:
replication.location-labels: ["dc","zone","rack","host"]
replication.location-labels: ["az","replication zone","rack","host"]
Copy link
Member

@nolouch nolouch Mar 14, 2023

Choose a reason for hiding this comment

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

What is the replication zone?

Copy link
Member

Choose a reason for hiding this comment

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

it's better use like "region","zone","host".

Copy link
Collaborator Author

@Oreoxmt Oreoxmt Mar 14, 2023

Choose a reason for hiding this comment

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

The replication zone label is used here:

tikv_servers:
- host: 10.63.10.30
config:
server.labels: { az: "1", replication zone: "1", rack: "1", host: "30" }
- host: 10.63.10.31
config:
server.labels: { az: "1", replication zone: "2", rack: "2", host: "31" }
- host: 10.63.10.32
config:
server.labels: { az: "2", replication zone: "3", rack: "3", host: "32" }
- host: 10.63.10.33
config:
server.labels: { az: "2", replication zone: "4", rack: "4", host: "33" }
- host: 10.63.10.34
config:
server.labels: { az: "3", replication zone: "5", rack: "5", host: "34" }
raftstore.raft-min-election-timeout-ticks: 1000
raftstore.raft-max-election-timeout-ticks: 1200


pd_servers:
- host: 10.63.10.10
Expand Down Expand Up @@ -134,15 +134,15 @@ alertmanager_servers:

PD 设置中添加 TiKV label 的等级配置。

```
```yaml
server_configs:
pd:
replication.location-labels: ["az","replication zone","rack","host"]
```

tikv_servers 设置基于 TiKV 真实物理部署位置的 Label 信息,方便 PD 进行全局管理和调度。

```
```yaml
tikv_servers:
- host: 10.63.10.30
config:
Expand All @@ -167,13 +167,13 @@ tikv_servers:

- 启用 TiKV gRPC 消息压缩。由于需要在网络中传输集群数据,可开启 gRPC 消息压缩,降低网络流量。

```
```yaml
server.grpc-compression-type: gzip
```

- 优化跨区域 AZ3 的 TiKV 节点网络,修改 TiKV 的如下参数,拉长跨区域副本参与选举的时间,避免跨区域 TiKV 中的副本参与 Raft 选举。

```
```yaml
raftstore.raft-min-election-timeout-ticks: 1000
raftstore.raft-max-election-timeout-ticks: 1200
```
Expand All @@ -187,7 +187,7 @@ tikv_servers:
- 禁止向跨区域 AZ 调度 Raft Leader,当 Raft Leader 在跨区域 AZ 时,会造成不必要的本区域 AZ 与远程 AZ 间的网络消耗,同时,网络带宽和延迟也会对 TiDB 的集群性能产生影响。

```
config set label-property reject-leader dc 3
config set label-property reject-leader az 3
```

> **注意:**
Expand Down
4 changes: 2 additions & 2 deletions two-data-centers-in-one-city-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TiDB 通常采用多 AZ 部署方案保证集群高可用和容灾能力。多 A

以下 `tiup topology.yaml` 示例拓扑文件为单区域双 AZ 典型的拓扑配置:

```
```yaml
# # Global variables are applied to all deployments and used as the default value of
# # the deployments if a specific deployment value is missing.
global:
Expand All @@ -48,7 +48,7 @@ global:
data_dir: "/data/tidb_cluster/tidb-data"
server_configs:
pd:
replication.location-labels: ["az","rack","host"]
replication.location-labels: ["az","rack","host"]
pd_servers:
- host: 10.63.10.10
name: "pd-10"
Expand Down