# Label configuration


![left](./student-guide/diagram/04-configuration-01-01.png)
------------------------------------------------------------
Above, you have understood the concept and function of labels. Next, let's take a look at how to set labels.

First, identify the format information of the label in the PD node, that is, the source information, as follows:

```
[replication]                     
location-labels = [“dc”，“zone”, “rack”, “host”] 
```
Among them, “DC”, “rack” and “host” refer to the data center, cabinet or rack and host, respectively, which are physical locations or devices, which are very understandable.

However, the concept of “zones” is actually a logical concept to indicate the smallest location that a replica can be isolated, and its number is always the same as the replica. For example, if we have 3 replicas by default, if we have 3 data centers (DCs), then we set up 3 zones, each corresponding to one datacenter (DC), and the replica in different zones. If we have 1 data center, but we have 3 racks, then we also set up 3 zones, each zone corresponds to a rack, and the replica are in different zones.

Secondly, let's take a look at the TiKV configuration. In the TiKV configuration,

```
tikv_servers:
  - host: 10.63.10.30
    config:
      server.labels: { dc: "1", zone: "1", rack: "1", host: "1" }
  - host: 10.63.10.31
    config:
      server.labels: { dc: "2", zone: "2", rack: "3", host: "6" }
  - host: 10.63.10.32
    config:
      server.labels: { dc: "3", zone: "3", rack: "5", host: "9" }
```

Interpretation is as follows:
  Host: Rack 1 cabinet in DC 1 data center at 10.63.10.30, host number 1, zone number 1.
  Host: 10.63.10.31 in the DC 2 data center rack 3 cabinet, host number 6, zone number 2.
  Host: Rack 5 cabinet in DC 3 data center where 10.63.10.32 is located. Host number 9 and zone number 3.

Based on the knowledge previously introduced, once the PD senses the location of the 3 hosts, it can place three replica of the region on the 3 hosts for maximum high availability.
