Line 58: field pd not found in type spec.topology

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

Original topic: line 58: field pd not found in type spec.topology

| username: Zhou_Ming

【TiDB Usage Environment】Production\Test Environment\POC
【TiDB Version】6.1
【Encountered Problem】
Error: Failed to parse topology file ./topology.yaml (topology.parse_failed)
caused by: yaml: unmarshal errors:
line 58: field pd not found in type spec.topology
【Reproduction Path】What operations were performed to encounter the problem
【Problem Phenomenon and Impact】
The configuration file is as follows

pd: 
  replication.enable-placement-rules: true
  replication.location-labels: ["host"]
  # tiflash:
  # tiflash-learner:

# # Server configs are used to specify the configuration of PD Servers.
pd_servers:
  # # The ip address of the PD Server.
  - host: 192.168.56.3
    # # SSH port of the server.
    # ssh_port: 22
    # # PD Server name
    # name: "pd-1"
    # # communication port for TiDB Servers to connect.
    # client_port: 2379
    # # Communication port among PD Server nodes.
    peer_port: 2380
    # # PD Server deployment file, startup script, configuration file storage directory.
    # deploy_dir: "/tidb-deploy/pd-2379"
    # # PD Server data storage directory.
    # data_dir: "/tidb-data/pd-2379"
    # # PD Server log file storage directory.
    # log_dir: "/tidb-deploy/pd-2379/log"
    # # numa node bindings.
    # numa_node: "0,1"
    # # The following configs are used to overwrite the `server_configs.pd` values.
    # config:
    #   schedule.max-merge-region-size: 20
    #   schedule.max-merge-region-keys: 200000

# # Server configs are used to specify the configuration of TiDB Servers.
tidb_servers:
  # # The ip address of the TiDB Server.
  - host: 192.168.56.3
    # # SSH port of the server.
    # ssh_port: 22
    # # The port for clients to access the TiDB cluster.
    port: 4000
    # # TiDB Server status API port.
    status_port: 10080
    # # TiDB Server deployment file, startup script, configuration file storage directory.
    # deploy_dir: "/tidb-deploy/tidb-4000"
    # # TiDB Server log file storage directory.
    # log_dir: "/tidb-deploy/tidb-4000/log"
  # # The ip address of the TiDB Server.
  - host: 192.168.56.3
    # ssh_port: 22
    port: 4001
    status_port: 10081
    # deploy_dir: "/tidb-deploy/tidb-4000"
    # log_dir: "/tidb-deploy/tidb-4000/log"
  - host: 192.168.56.3
    # ssh_port: 22
    port: 4002
    status_port: 10082
    # deploy_dir: "/tidb-deploy/tidb-4000"
    # log_dir: "/tidb-deploy/tidb-4000/log"

# # Server configs are used to specify the configuration of TiKV Servers.
tikv_servers:
  # # The ip address of the TiKV Server.
  - host: 192.168.56.3
    # # SSH port of the server.
    # ssh_port: 22
    # # TiKV Server communication port.
    port: 20160
    # # TiKV Server status API port.
    status_port: 20180
    # # TiKV Server deployment file, startup script, configuration file storage directory.
    deploy_dir: "/tidb-deploy/tikv-20160"
    # # TiKV Server data storage directory.
    data_dir: "/tidb-data/tikv-20160"
    # # TiKV Server log file storage directory.
    log_dir: "/tidb-deploy/tikv-20160/log"
    # # The following configs are used to overwrite the `server_configs.tikv` values.
    config:
        server.labels:
           host: host1   
  - host: 192.168.56.3
    # # SSH port of the server.
    # ssh_port: 22
    # # TiKV Server communication port.
    port: 20161
    # # TiKV Server status API port.
    status_port: 20181
    # # TiKV Server deployment file, startup script, configuration file storage directory.
    deploy_dir: "/tidb-deploy/tikv-20161"
    # # TiKV Server data storage directory.
    data_dir: "/tidb-data/tikv-20161"
    # # TiKV Server log file storage directory.
    log_dir: "/tidb-deploy/tikv-20161/log"
    # # The following configs are used to overwrite the `server_configs.tikv` values.
    config:
        server.labels:
           host: host1

Where is the configuration wrong? Thank you.

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

The format gets messed up when pasted in, it’s easier to read using code blocks. Check what the content of the error line is.

| username: TiDBer_wTKU9jv6 | Original post link

Modify the format, or paste the image.

| username: ShawnYan | Original post link

This is a configuration file format issue that needs to be readjusted.

| username: cs58_dba | Original post link

Please use markdown syntax or send a txt file, it’s hard to parse this way.

| username: songxuecheng | Original post link

Configuration issue. It will indicate which line to modify directly.

| username: 箱子NvN | Original post link

There is an issue with the YAML format. You can check the error at line 58. You can also find websites online to validate the YAML format by pasting it in.

| username: ablewang_xiaobo | Original post link

Brother, there is an issue with your configuration file. I suggest uploading the YAML configuration file for everyone’s reference.

| username: ablewang_xiaobo | Original post link

Here is the YAML file I used in a standalone environment, you can refer to it or refer to the official website. tidb_standalone.yml (2.3 KB)

| username: banana_jian | Original post link

These two lines of configuration should be in the server_configs section.

| username: hey-hoho | Original post link

It’s really hard to look at, so I wrapped it in a code block for you. :joy:

From the information you uploaded, there are two configuration issues with PD. The correct format should be like this:

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.