How to set "Recommend PD and TiKV to use different disks"?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 怎么设置"推荐 PD 和 TiKV 采用不同的磁盘" ?

| username: abelard2008

I am reading the article Best Practices for Three-Node Hybrid Deployment, and I happen to be setting up such a cluster. However, I have two questions about the article:

  1. In the article:
    “Three physical machines, each with 16 CPU cores and 32 GB of memory. Each node (machine) has 1 TiDB (instance) + 1 TiKV (instance) + 1 PD (instance) deployed in a hybrid manner.”
    So, does that mean there are a total of 3 TiDB + 3 TiKV + 3 PD across the three machines?

  2. In the article:
    “Since both PD and TiKV store information on disk, the read and write latency of the disk will directly affect the service latency of PD and TiKV. To prevent PD and TiKV from competing for disk resources and affecting each other, it is recommended that PD and TiKV use different disks.”
    How can I achieve using different disks for PD and TiKV? My current yml file is as follows, and I don’t see any parameters to set different disks:

    global:
      user: "root"
      ssh_port: 22
    server_configs:
      pd:
          replication.location-labels: [host]
    tidb_servers:
      - host: 192.168.9.81
        port:  4000
        status_port: 10080
      - host: 192.168.9.82
        port: 4000
        status_port: 10080
      - host: 192.168.9.83
        port: 4000
        status_port: 10080    
    pd_servers:
      - host: 192.168.9.81
        client_port: 2379
        peer_port: 2380
      - host: 192.168.9.82
        client_port: 2379
        peer_port: 2380
      - host: 192.168.9.83
        client_port: 2379
        peer_port: 2380
    
    tikv_servers:
      - host: 172.168.9.81
        port: 20160
        status_port: 10080
        deploy_dir: "/data/sdc/tikv-cluster/tikv-deploy"
        data_dir: "/data/sdc/tikv-cluster/tikv-data"
        config:
            server.labels:
                host: "tikv-81"
      - host: 192.168.9.82
        port: 20160
        status_port: 10080
        deploy_dir: "/data/sdc/tikv-cluster/tikv-deploy"
        data_dir: "/data/sdc/tikv-cluster/tikv-data"
        config:
            server.labels:
                host: "tikv-82"
      - host: 192.168.9.83
        port: 20160
        status_port: 10080
        deploy_dir: "/data/sdc/tikv-cluster/tikv-deploy"
        data_dir: "/data/sdc/tikv-cluster/tikv-data"
        config:
            server.labels:
                host: "tikv-83"
    

    What parameters should I use to set the directory for PD? For example, TiKV has data_dir and deploy_dir, but what about PD? Can I also add data_dir and deploy_dir for PD? Where can I find documentation about these parameters? I checked in tiup but couldn’t find it, probably because I didn’t look in the right place.

| username: WalterWj | Original post link

Just configure the data-dir.

| username: 啦啦啦啦啦 | Original post link

Just use different physical disks for different paths, otherwise, there might be IO contention.

| username: tidb菜鸟一只 | Original post link

You can definitely mount different disks to different paths, just configure PD and TiKV to different paths.

| username: 特雷西-迈克-格雷迪 | Original post link

What he means is that PD does not have a datadir directory.

| username: tidb菜鸟一只 | Original post link

If it is as the person above mentioned, you can configure it like this. /data1 and /data for your TiKV use different disk mounts, so PD and TiKV will use different disks, which will reduce IO competition.

| username: Running | Original post link

According to the tags

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.