Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: kafka: client has run out of available brokers to talk to (Is your cluster reachable?) #98

Open
pradipdevops opened this issue Mar 30, 2019 · 7 comments

Comments

@pradipdevops
Copy link

not able to run kafka_exporter with below details :

kafka sasl details in server.properties file:

listener.security.protocol.map=SASL_PLAINTEXT:SASL_PLAINTEXT
sasl.enabled.mechanisms=SCRAM-SHA-256
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-256
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer

Comamnd:

nohup ./kafka_exporter --kafka.version="2.2.0" --no-sasl.handshake --sasl.enabled --sasl.username="xyz" --sasl.password="abc" --kafka.server=10.0.0.1:9091 --kafka.server=10.0.0.2:9092 --kafka.server=10.0.0.3:9093 --log.level="debug" --log.enable-sarama --log.format="logger:syslog?appname=bob&local=7" &

Error:

panic: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

goroutine 1 [running]:
main.NewExporter(0xc4201d2140, 0x3, 0x4, 0x1, 0x7ffe159a844c, 0x5, 0x7ffe159a8462, 0xe, 0x0, 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

@squ1d123
Copy link
Contributor

squ1d123 commented Apr 11, 2019

This is due to kafka-exporter not supporting SCRAM as a sasl mechanism. At the moment it only supports PLAN as a SASL mechanism. This is due to go library that kafka-exporter uses (samara) didn't support it. However the good news it that samara now supports it IBM/sarama#1295.

@pradipdevops
Copy link
Author

Hi squ1d123,
Thanks, as you know go library samara now supports SCARM as a sasl mechanism, can we know when Kafka exporter support SCRAM as a sasl mechanism? estimate next prod release date?

@squ1d123
Copy link
Contributor

I have just opened #101 to support this, feel free to use my branch in the meantime if you want to try it out

@squ1d123 squ1d123 mentioned this issue Apr 11, 2019
@codebyte
Copy link

KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://:9092'

Add this under kakfa docker

@jayson-wang
Copy link

I had the same problem
i want to use SCRAM-SHA-256
but report this error
The latest version is still 1.2 now

@hugo-oliveira-jumia
Copy link

im facing the same issue.
I use the following configurations

sasl.enabled.mechanisms=SCRAM-SHA-256,SCRAM-SHA-512
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-512
security.inter.broker.protocol=SASL_PLAINTEXT

Is there any further development in this topic?

@theliuk
Copy link

theliuk commented Jan 20, 2021

I'm facing the same issue with a Kafka instance running on Confluent.
I provided the following configuration:

--kafka.server="<kafka cluster>" --sasl.enabled --tls.enabled --sasl.username="<username>" --sasl.password="<password>"

I usually use SASL PLAIN mechanism to access my Kafka instance for other purposes.

I get

ERRO[0001] Error Init Kafka Client                       source="kafka_exporter.go:184"
panic: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

goroutine 1 [running]:
main.NewExporter(0xc420130280, 0x1, 0x1, 0x101, 0x7ffc35e1ff14, 0x10, 0x7ffc35e1ff35, 0x40, 0x1, 0x96d438, ...)
	/home/travis/gopath/src/github.com/danielqsj/kafka_exporter/kafka_exporter.go:185 +0xbbc
main.main()
	/home/travis/gopath/src/github.com/danielqsj/kafka_exporter/kafka_exporter.go:606 +0x3aa7

UPDATE

It works with this configuration:

docker run -ti --rm -p 9308:9308 kafka-exporter-image \
	--kafka.server=CLUSTER-URI\
	--sasl.enabled \
	--tls.insecure-skip-tls-verify --tls.enabled \
	--sasl.username=XXXXX \
	--sasl.password=YYYYY \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants