Skip to content

Commit

Permalink
how-to/deploy: add usage precautions for labels (#1929)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilin90 committed Oct 10, 2019
1 parent b2ba914 commit b2bd5d6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dev/how-to/deploy/geographic-redundancy/location-awareness.md
Expand Up @@ -46,6 +46,10 @@ location-labels = ["zone", "rack", "host"]

其中 `location-labels` 需要与 TiKV 的 `labels` 名字对应,这样 PD 才能知道这些 `labels` 代表了 TiKV 的拓扑结构。

> **注意:**
>
> 必须同时配置 PD 的 `location-labels` 和 TiKV 的 `labels` 参数,否则 `labels` 不会生效。
## PD 基于 TiKV 拓扑结构进行调度

PD 能够根据我们提供的拓扑信息作出最优的调度,我们只需要关心什么样的拓扑结构能够达到我们想要的效果。
Expand Down
2 changes: 2 additions & 0 deletions dev/how-to/deploy/orchestrated/ansible.md
Expand Up @@ -455,6 +455,7 @@ mount -t ext4
172.16.10.2
172.16.10.3

# 注意:要使用 TiKV 的 labels,必须同时配置 PD 的 location_labels 参数,否则 labels 设置不生效。
[tikv_servers]
TiKV1-1 ansible_host=172.16.10.4 deploy_dir=/data1/deploy tikv_port=20171 labels="host=tikv1"
TiKV1-2 ansible_host=172.16.10.4 deploy_dir=/data2/deploy tikv_port=20172 labels="host=tikv1"
Expand Down Expand Up @@ -485,6 +486,7 @@ TiKV3-2 ansible_host=172.16.10.6 deploy_dir=/data2/deploy tikv_port=20172 labels
172.16.10.5
172.16.10.6

# 注意:为使 TiKV 的 labels 设置生效,部署集群时必须设置 PD 的 location_labels 参数。
[pd_servers:vars]
location_labels = ["host"]
```
Expand Down
Expand Up @@ -42,6 +42,10 @@ location-labels = ["zone", "rack", "host"]

其中 `location-labels` 需要与 TiKV 的 `labels` 名字对应,这样 PD 才能知道这些 `labels` 代表了 TiKV 的拓扑结构。

> **注意:**
>
> 必须同时配置 PD 的 `location-labels` 和 TiKV 的 `labels` 参数,否则 `labels` 不会生效。
## PD 基于 TiKV 拓扑结构进行调度

PD 能够根据我们提供的拓扑信息作出最优的调度,我们只需要关心什么样的拓扑结构能够达到我们想要的效果。
Expand Down
2 changes: 2 additions & 0 deletions v2.1/how-to/deploy/orchestrated/ansible.md
Expand Up @@ -380,6 +380,7 @@ UUID=c51eb23b-195c-4061-92a9-3fad812cc12f /data1 ext4 defaults,nodelalloc,noatim
172.16.10.2
172.16.10.3

# 注意:要使用 TiKV 的 labels,必须同时配置 PD 的 location_labels 参数,否则 labels 设置不生效。
[tikv_servers]
TiKV1-1 ansible_host=172.16.10.4 deploy_dir=/data1/deploy tikv_port=20171 labels="host=tikv1"
TiKV1-2 ansible_host=172.16.10.4 deploy_dir=/data2/deploy tikv_port=20172 labels="host=tikv1"
Expand Down Expand Up @@ -410,6 +411,7 @@ TiKV3-2 ansible_host=172.16.10.6 deploy_dir=/data2/deploy tikv_port=20172 labels
172.16.10.5
172.16.10.6

# 注意:为使 TiKV 的 labels 设置生效,部署集群时必须设置 PD 的 location_labels 参数。
[pd_servers:vars]
location_labels = ["host"]
```
Expand Down

0 comments on commit b2bd5d6

Please sign in to comment.