0

我有一个 docker compose 文件:

   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在电报配置中定义了。

4

0 回答 0