danielqsj / kafka_exporter

Kafka exporter for Prometheus
Apache License 2.0
2.1k stars 602 forks source link

kafka: client has run out of available brokers #303

Open cedricve opened 2 years ago

cedricve commented 2 years ago

I can no longer connect to my Kafka cluster, with the exporter.

    I0228 13:14:49.563301       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)
    F0228 13:14:50.434363       1 kafka_exporter.go:865] Error Init Kafka Client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
    I0228 13:15:07.034314       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)
    F0228 13:15:08.186279       1 kafka_exporter.go:865] Error Init Kafka Client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
    I0228 13:15:34.975282       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)
    F0228 13:15:36.018607       1 kafka_exporter.go:865] Error Init Kafka Client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
    I0228 13:16:16.932958       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)
    F0228 13:16:18.040487       1 kafka_exporter.go:865] Error Init Kafka Client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
    I0228 13:17:48.925093       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)

I'm using the bitnami/kafka helm chart. Which is using

    image:
      registry: docker.io
      repository: bitnami/kafka
      tag: 3.1.0-debian-10-r29
zhiyuan192shine commented 2 years ago

I use it to work normally。 command is: ./kafka_exporter --kafka.server="xxx:9092" --sasl.enabled --sasl.mechanism="gssapi" --sasl.service-name="kafka" --sasl.kerberos-config-path="/etc/krb5.conf" --sasl.realm="GLPROP.COM" --sasl.keytab-path="/etc/security/keytab/bigdata.keytab" --sasl.kerberos-auth-type="keytabAuth" --sasl.username="bigdata"

ynb97 commented 2 years ago

I can no longer connect to my Kafka cluster, with the exporter.

    I0228 13:14:49.563301       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)
    F0228 13:14:50.434363       1 kafka_exporter.go:865] Error Init Kafka Client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
    I0228 13:15:07.034314       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)
    F0228 13:15:08.186279       1 kafka_exporter.go:865] Error Init Kafka Client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
    I0228 13:15:34.975282       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)
    F0228 13:15:36.018607       1 kafka_exporter.go:865] Error Init Kafka Client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
    I0228 13:16:16.932958       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)
    F0228 13:16:18.040487       1 kafka_exporter.go:865] Error Init Kafka Client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
    I0228 13:17:48.925093       1 kafka_exporter.go:769] Starting kafka_exporter (version=1.4.2, branch=non-git, revision=non-git)

I'm using the bitnami/kafka helm chart. Which is using

    image:
      registry: docker.io
      repository: bitnami/kafka
      tag: 3.1.0-debian-10-r29

I was facing the same issue. I'm using confluent kafka docker image for my cluster and docker for kafka_exporter as well.

I'm using TLS authentication to connect to the cluster and the command that was causing the issue was like this

docker run -ti --rm -p 9308:9308 danielqsj/kafka-exporter:v1.4.2 --kafka.server=<host>:<port> --tls.enabled --tls.ca-file=/path/to/ca-cert --tls.cert-file=/path/to/client-cert.pem --tls.key-file=/path/to/client.key

This was giving the error, but when I added this --tls.insecure-skip-tls-verify it started working