telegraf无法解析kafka使用者输入

e5njpo68  于 2021-06-06  发布在  Kafka
关注(0)|答案(0)|浏览(287)

我有一个docker文件:

influx:
    image: influxdb:latest
    container_name: influxdb
    ports:
    - "8083:8083"
    - "8086:8086"
    - "8090:8090"
  telegraf:
    image: telegraf:latest
    container_name: telegraf
    links:
    - influx
    volumes:
    - ./telegraf.conf:/etc/telegraf/telegraf.conf:ro
  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    ports:
        - "3000:3000"
    links:
        - influx

我有一个telegraf conf文件,其中我把Kafka主题作为输入源

[[inputs.kafka_consumer]]
  ## topic(s) to consume
  topics = ["telegraf"]

  ## an array of Zookeeper connection strings
  zookeeper_peers = ["zookeeper:2181"]
  ## Zookeeper Chroot
  zookeeper_chroot = ""
  ## the name of the consumer group
  consumer_group = "telegraf_metrics_consumers"
  ## Offset (must be either "oldest" or "newest")
  offset = "oldest"

  ## Data format to consume.
  ## Each data format has it's own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "influx"

当我跑的时候 docker-compose up ,telegraf容器未启动。它给出了以下错误:

Error parsing /etc/telegraf/telegraf.conf, line 1722: field corresponding to 'zookeeper_peers' is not defined in kafka_consumer.Kafka

但是,我已经定义了 zookeeper_peers 在telegraf配置中。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题