Telegraf ..could not initialize output kafka: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

Execute telegraf -config ~/telegraf.conf -test

2021-02-17T19:40:40Z I! Starting Telegraf 1.17.2
2021-02-17T19:40:40Z D! [agent] Initializing plugins
2021-02-17T19:40:40Z W! [kafka] enable_tls is deprecated, and the setting does nothing, you can safely remove it from the config
2021-02-17T19:40:40Z D! [sarama] Initializing new client
2021-02-17T19:40:40Z D! [sarama] client/metadata fetching metadata for all topics from broker 127.0.0.1:9092
2021-02-17T19:40:40Z D! [sarama] Connected to broker at 127.0.0.1:9092 (unregistered)
2021-02-17T19:40:40Z D! [sarama] client/metadata got error from broker -1 while fetching metadata: read tcp 127.0.0.1:42130->127.0.0.1:9092: read: connection reset by peer
2021-02-17T19:40:40Z D! [sarama] Closed connection to broker 127.0.0.1:9092
2021-02-17T19:40:40Z D! [sarama] client/metadata no available broker to send metadata request to
2021-02-17T19:40:40Z D! [sarama] client/brokers resurrecting 1 dead seed brokers
2021-02-17T19:40:40Z D! [sarama] client/metadata retrying after 250ms… (3 attempts remaining)
2021-02-17T19:40:40Z D! [sarama] client/metadata fetching metadata for all topics from broker 127.0.0.1:9092
2021-02-17T19:40:40Z D! [sarama] Connected to broker at 127.0.0.1:9092 (unregistered)
2021-02-17T19:40:40Z D! [sarama] client/metadata got error from broker -1 while fetching metadata: read tcp 127.0.0.1:42132->127.0.0.1:9092: read: connection reset by peer
2021-02-17T19:40:40Z D! [sarama] Closed connection to broker 127.0.0.1:9092
2021-02-17T19:40:40Z D! [sarama] client/metadata no available broker to send metadata request to
2021-02-17T19:40:40Z D! [sarama] client/brokers resurrecting 1 dead seed brokers
2021-02-17T19:40:40Z D! [sarama] client/metadata retrying after 250ms… (2 attempts remaining)
2021-02-17T19:40:40Z D! [sarama] client/metadata fetching metadata for all topics from broker 127.0.0.1:9092
2021-02-17T19:40:40Z D! [sarama] Connected to broker at 127.0.0.1:9092 (unregistered)
2021-02-17T19:40:40Z D! [sarama] client/metadata got error from broker -1 while fetching metadata: read tcp 127.0.0.1:42134->127.0.0.1:9092: read: connection reset by peer
2021-02-17T19:40:40Z D! [sarama] Closed connection to broker 127.0.0.1:9092
2021-02-17T19:40:40Z D! [sarama] client/metadata no available broker to send metadata request to
2021-02-17T19:40:40Z D! [sarama] client/brokers resurrecting 1 dead seed brokers
2021-02-17T19:40:40Z D! [sarama] client/metadata retrying after 250ms… (1 attempts remaining)
2021-02-17T19:40:41Z D! [sarama] client/metadata fetching metadata for all topics from broker 127.0.0.1:9092
2021-02-17T19:40:41Z D! [sarama] Connected to broker at 127.0.0.1:9092 (unregistered)
2021-02-17T19:40:41Z D! [sarama] client/metadata got error from broker -1 while fetching metadata: read tcp 127.0.0.1:42136->127.0.0.1:9092: read: connection reset by peer
2021-02-17T19:40:41Z D! [sarama] Closed connection to broker 127.0.0.1:9092
2021-02-17T19:40:41Z D! [sarama] client/metadata no available broker to send metadata request to
2021-02-17T19:40:41Z D! [sarama] client/brokers resurrecting 1 dead seed brokers
2021-02-17T19:40:41Z D! [sarama] Closing Client
2021-02-17T19:40:41Z E! [telegraf] Error running agent: could not initialize output kafka: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

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

Configuration for telegraf agent

[topics]
[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

[[inputs.redfish]]
address = “10.8.1.164”
username = “Administrator”
password = “superuser”
computer_system_id=“Self”
timeout = “60s”
insecure_skip_verify = true
name_suffix = “_zt”
[[inputs.redfish]]
address = “https://10.8.1.164]”
username = “Administrator”
password = “superuser”
computer_system_id=“Self”
timeout = “60s”
insecure_skip_verify = true
name_suffix = “_zt”
[[processors.converter]]
[processors.converter.fields]
tag = [“upper_threshold_critical”,“upper_threshold_fatal”,“lower_threshold_critical”,“lower_threshold_fatal”]

Hello,

From looking at the error messages coming from sarama I found some issues on samara which may be relevant to your setup:

client has run out of available brokers to talk to

client/metadata got error from broker -1 while fetching metadata

If you output instead to stdout what do you get?

[[outputs.file]]
  files=["stdout"]
  data_format = "influx"

For your output config you can remove enable_tls and the tls cert stuff.

In the docs it suggests you can add a kafka version which may help:

Set the minimal supported Kafka version. Setting this enables the use of new
Kafka features and APIs. Of particular interest, lz4 compression
requires at least version 0.10.0.0.
ex: version = “1.1.0”
version = “”