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

【 TiDB 使用环境】生产\测试环境\ POC
【 TiDB 版本】6.1
【遇到的问题】
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
【复现路径】做过哪些操作出现的问题
【问题现象及影响】
配置文件如下

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

这是哪里配置不对啊? 谢谢

格式粘贴进来都乱了,用代码块看会容易些,看看报错这一行是什么内容

改改格式,或者粘图出来

这就是配置文件格式问题,需要重新调整下。

用markdown语法或者发txt吧,这样不好解析

配置问题 提示哪一行 直接去修改就好

yaml 的格式有问题 可以看一下报错的第58行 还可以上网上找校验yaml格式的网站粘贴进去看看

兄弟,你的配置文件有问题,建议上传配置文件的yaml文件大家好办理参考。

下面是我单机环境下用的yaml文件,可以参考或者参考官网。tidb_standalone.yml (2.3 KB)

pd:
replication.enable-placement-rules: true
replication.location-labels: [“host”]

这两行配置应该在server_configs 的段落里

1 个赞

看着太难受了,我给你用代码块包了一下:joy:

从你上传的信息来看,pd的两个配置有问题,正确格式应该是这样的:

该主题在最后一个回复创建后60天后自动关闭。不再允许新的回复。