kafka_exporter icon indicating copy to clipboard operation
kafka_exporter copied to clipboard

Kafka exporter not working with SASL/SCRAM

Open tonyjune opened this issue 5 years ago • 10 comments

Our kafka cluster has SASL/SCRAM security mechanism and kafka exporter throws this error-

INFO[0000] Starting kafka_exporter (version=1.2.0, branch=HEAD, revision=830660212e6c109e69dcb1cb58f5159fe3b38903)  source="kafka_exporter.go:474"
INFO[0000] Build context (go=go1.10.3, user=root@981cde178ac4, date=20180707-14:34:48)  source="kafka_exporter.go:475"
ERRO[0001] Error Init Kafka Client                       source="kafka_exporter.go:210"
panic: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

goroutine 1 [running]:
main.NewExporter(0xc42006a420, 0x1, 0x1, 0x100, 0x7ffd8252476a, 0xb, 0x7ffd82524786, 0x12, 0x1, 0x7ffd825247a7, ...)
        /go/src/github.com/danielqsj/kafka_exporter/kafka_exporter.go:211 +0x847
main.main()
        /go/src/github.com/danielqsj/kafka_exporter/kafka_exporter.go:481 +0x215b

PS- It works fine with SASL/PLAIN. Is it known issue?

tonyjune avatar Sep 02 '19 08:09 tonyjune

Can you please post your configuration parameters for SASL/PLAIN? I am attempting to connect to a ConfluentCloud hosted Kafka cluster authenticated with sasl.mechanism=PLAIN and security.protocol=SASL_SSL

tmendenhall avatar Oct 11 '19 15:10 tmendenhall

Can you please post your configuration parameters for SASL/PLAIN? I am attempting to connect to a ConfluentCloud hosted Kafka cluster authenticated with sasl.mechanism=PLAIN and security.protocol=SASL_SSL

Me too and it works now with --tls.insecure-skip-tls-verify and --tls.enabled

View my reply here: https://github.com/danielqsj/kafka_exporter/issues/116#issuecomment-559108062

sebco59 avatar Nov 27 '19 14:11 sebco59

Only needed to add --tls.insecure-skip-tls-verify in my case, thanks for your reply :+1:

knil-sama avatar Feb 24 '20 09:02 knil-sama

I have the same "issue", But add --tls.insecure-skip-tls-verify does not working for me. I'm no using TLS.

Parameters for SASL:

bootstrap.servers=localhost:9092
security.protocol=SASL_PLAINTEXT
sasl.mechanism=SCRAM-SHA-256

./kafka_exporter --sasl.enabled --sasl.username="xxx" --sasl.password="xxx" --tls.enabled --tls.insecure-skip-tls-verify --kafka.version=2.12.2 --log.level=debug

INFO[0000] Starting kafka_exporter (version=1.2.0, branch=HEAD, revision=830660212e6c109e69dcb1cb58f5159fe3b38903)  source="kafka_exporter.go:474"
INFO[0000] Build context (go=go1.10.3, user=root@981cde178ac4, date=20180707-14:34:48)  source="kafka_exporter.go:475"
ERRO[0000] Error Init Kafka Client                       source="kafka_exporter.go:210"
panic: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

goroutine 1 [running]:
main.NewExporter(0xc4200817c0, 0x1, 0x1, 0x101, 0x7ffd57bb8606, 0x5, 0x7ffd57bb861c, 0xd, 0x1, 0x8f22f8, ...)
	/go/src/github.com/danielqsj/kafka_exporter/kafka_exporter.go:211 +0x847
main.main()
	/go/src/github.com/danielqsj/kafka_exporter/kafka_exporter.go:481 +0x215b

leonrado avatar Mar 23 '20 13:03 leonrado

I met the same mistake, is there any solution

yuanyp8 avatar Apr 03 '20 09:04 yuanyp8

I met the same mistake, is there any solution

wangmingch avatar Jul 31 '20 08:07 wangmingch

I am also running into the same issue.

srirajk avatar Feb 13 '21 16:02 srirajk

it looks like the latest docker image does not have the changes for scram support. Its not built from master branch

srirajk avatar Feb 13 '21 17:02 srirajk

what worked for me is

./kafka_exporter  --kafka.server=url:port \
  --web.listen-address=:7071 \
  --sasl.enabled \
  --sasl.username="user" \
  --sasl.password="password" \
  --sasl.kerberos-auth-type="userAuth" \
  --sasl.mechanism="scram-sha512" \
  --tls.insecure-skip-tls-verify \
  --tls.enabled \
  --log.level=debug

sandjaie avatar Dec 27 '22 08:12 sandjaie

Thanks @sandjaie for the solution, I was missing --sasl.enabled

reilee avatar Sep 29 '23 04:09 reilee