我正在使用sharmago客户端,在eks(amazonk8)集群上连接aws-msk,我正在使用下面的代码
config := sarama.NewConfig()
config.Consumer.Return.Errors = true
kafkaClient, err = sarama.NewClient(brokerAddress, config)
brokerAddress is an array of string value is [http://kafka-broker-url-1:9092, http://kafka-broker-url-2:9092]
I am getting an error
Kafka: the client has run out of available brokers to talk to (Is your cluster reachable?)
I also tried below code snippet to connect but got the same error:
admin, err := sarama.NewClusterAdmin(brokerAddress, config)
if err != nil {
KafkaLogger.Info("Error while creating cluster admin: ", err.Error())
}
Is there any config setting which I am missing?
In the same container(to verify cluster), I tried to create a topic using Kafka script and was able to connect via zookeeper[i used a script which is present inside the bin folder,https://downloads.apache.org/kafka/2.2.2/kafka_2.11-2.2.2.tgz]
./kafka-topics.sh --create --zookeeper z-kafka.us-west-2.amazonaws.com:2181 --replication-factor 1 --partitions 1 --topic Test
暂无答案!
目前还没有任何答案,快来回答吧!