Error from broker when executing telegraf --config /etc/telegraf/telegraf.conf

Error from broker when executing [root@scottsys ~]# telegraf --config /etc/telegraf/telegraf.conf

Telegraf 1.17.1
Kafka 2.13-2.7.0

telegraf.conf

[root@scottsys ~]# cat /etc/telegraf/telegraf.conf
[tags]

Configuration for telegraf agent

[agent]
interval = “60s”
debug = true
quiet = false
round_interval = true
metric_batch_size = 8000
metric_buffer_limit = 20000
flush_interval = “60s”
flush_jitter = “30s”
precision = “s”
[[outputs.kafka]]

URLs of kafka brokers

brokers = [“127.0.0.1:9092”]

Kafka topic for producer messages

topic = “hardwaremetrics”
enable_tls = false

tls_ca = “/etc/telegraf/ca.cer.pem”

tls_cert = “/etc/telegraf/client.cer.pem”

tls_key = “/etc/telegraf/client.key.pem”

insecure_skip_verify = true

DR - ZT

Error

[root@scottsys ~]# telegraf --config /etc/telegraf/telegraf.conf
2021-02-17T23:17:10Z I! Starting Telegraf 1.17.2
2021-02-17T23:17:10Z I! Loaded inputs: redfish (2x)
2021-02-17T23:17:10Z I! Loaded aggregators:
2021-02-17T23:17:10Z I! Loaded processors: converter
2021-02-17T23:17:10Z I! Loaded outputs: kafka
2021-02-17T23:17:10Z I! Tags enabled: dc=welktxef.vzcpe.net host=scottsys
2021-02-17T23:17:10Z I! [agent] Config: Interval:1m0s, Quiet:false, Hostname:“scottsys”, Flush Interval:1m0s
2021-02-17T23:17:10Z D! [agent] Initializing plugins
2021-02-17T23:17:10Z W! [kafka] enable_tls is deprecated, and the setting does nothing, you can safely remove it from the config
2021-02-17T23:17:10Z D! [sarama] Initializing new client
2021-02-17T23:17:10Z D! [sarama] client/metadata fetching metadata for all topics from broker 127.0.0.1:9092
2021-02-17T23:17:10Z D! [sarama] Connected to broker at 127.0.0.1:9092 (unregistered)
2021-02-17T23:17:10Z D! [sarama] client/metadata got error from broker -1 while fetching metadata: read tcp 127.0.0.1:45836->127.0.0.1:9092: read: connection reset by peer
2021-02-17T23:17:10Z D! [sarama] Closed connection to broker 127.0.0.1:9092
2021-02-17T23:17:10Z D! [sarama] client/metadata no available broker to send metadata request to
2021-02-17T23:17:10Z D! [sarama] client/brokers resurrecting 1 dead seed brokers
2021-02-17T23:17:10Z D! [sarama] client/metadata retrying after 250ms… (3 attempts remaining)
2021-02-17T23:17:11Z D! [sarama] client/metadata fetching metadata for all topics from broker 127.0.0.1:9092
2021-02-17T23:17:11Z D! [sarama] Connected to broker at 127.0.0.1:9092 (unregistered)
2021-02-17T23:17:11Z D! [sarama] client/metadata got error from broker -1 while fetching metadata: read tcp 127.0.0.1:45838->127.0.0.1:9092: read: connection reset by peer

Your kafka broker closed the connection to telegraf. You may want to check the logs of the broker to see if it says why it closed the connection.

I’m not sure if you are intending to use tls. You have tls_* settings but enable_tls is false. This setting is no longer used, so telegraf may be trying to connect with tls when kafka isn’t configured to use it. This might cause the broker to close the connection.

You may also want to try using a different producer tool to connect to the same broker and write to the same topic. You could try kafka-console-producer.sh that comes with kafka or kafka-console-producer that comes with the sarama library. If you are able to write to the broker with those tools it may be that there is a compatibility bug between the sarama library that telegraf uses and the specific broker config you are using.