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

Created on 30 Aug 2017  Â·  6Comments  Â·  Source: Shopify/sarama

kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
config := cluster.NewConfig()
config.Consumer.Return.Errors = true
config.Group.Return.Notifications = true
config.Consumer.Offsets.CommitInterval = 5 * time.Second
config.Consumer.Offsets.Initial = sarama.OffsetOldest
// init consumer
brokers := Config.KafkaBroker()
topics := Config.KafkaTopic()
groupId, _ := Config.Cfg.String("Kafka.GroupId")
groupId = "my-consumer-group"
fmt.Println(brokers)
consumer, err := cluster.NewConsumer(brokers, groupId, topics, config)
if err != nil {
fmt.Println(err)
panic(err)
}
defer consumer.Close()
brokers is [10.0.8.58:9092 10.0.8.83:9092 10.0.8.84:9092]

Most helpful comment

Oh, are you using sarama-cluster (https://github.com/bsm/sarama-cluster/)? Yes, I believe that requires Kafka 0.9 or later.

All 6 comments

Are any of those addresses actually reachable from where you're running the client? Can you ping them? Can you connect with a different Kafka client?

Yes it production environment server.Testing environment is ok.
Before i write it in php,testing environment is ok,production environment can't get message.
Testing environment:kafka_2.11-0.10.0.0 1 host
production environment :kafka_2.9.2-0.8.1.1 3 host

Is there any more information in the Sarama logs?

I feel ,it's don't support kafka_2.9.2-0.8.1.1 3

kafka log:
ERROR Closing socket for /127.0.0.1 because of error (kafka.network.Processor)
kafka.common.KafkaException: Wrong request type 10
at kafka.api.RequestKeys$.deserializerForKey(RequestKeys.scala:57)
at kafka.network.RequestChannel$Request.(RequestChannel.scala:53)
at kafka.network.Processor.read(SocketServer.scala:353)
at kafka.network.Processor.run(SocketServer.scala:245)
at java.lang.Thread.run(Thread.java:748)

Oh, are you using sarama-cluster (https://github.com/bsm/sarama-cluster/)? Yes, I believe that requires Kafka 0.9 or later.

Yes,I use it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DimaSalakhov picture DimaSalakhov  Â·  5Comments

amitgurav04 picture amitgurav04  Â·  7Comments

ruixule picture ruixule  Â·  5Comments

damiannolan picture damiannolan  Â·  7Comments

Zaazik picture Zaazik  Â·  3Comments