16/12/16 11:30:51 INFO client.ClientUtils$: Fetching metadata from broker BrokerEndPoint(0,act201,9092) with correlation id 5 for 1 topic(s) Set(ncytest1)
16/12/16 11:30:51 INFO producer.SyncProducer: Connected to act201:9092 for producing
16/12/16 11:30:51 INFO producer.SyncProducer: Disconnecting from act201:9092
16/12/16 11:30:51 WARN producer.BrokerPartitionInfo: Error while fetching metadata [{TopicMetadata for topic ncytest1 ->
No partition metadata for topic ncytest1 due to org.apache.kafka.common.errors.LeaderNotAvailableException}] for topic [ncytest1]: class org.apache.kafka.common.errors.LeaderNotAvailableException
16/12/16 11:30:51 ERROR async.DefaultEventHandler: Failed to collate messages by topic, partition due to: Failed to fetch topic metadata for topic: ncytest1
16/12/16 11:30:51 INFO async.DefaultEventHandler: Back off for 100 ms before retrying send. Remaining retries = 1
16/12/16 11:30:51 INFO client.ClientUtils$: Fetching metadata from broker BrokerEndPoint(1,act202,9092) with correlation id 6 for 1 topic(s) Set(ncytest1)
16/12/16 11:30:51 INFO producer.SyncProducer: Connected to act202:9092 for producing
16/12/16 11:30:51 INFO producer.SyncProducer: Disconnecting from act202:9092
16/12/16 11:30:51 WARN producer.BrokerPartitionInfo: Error while fetching metadata [{TopicMetadata for topic ncytest1 ->
No partition metadata for topic ncytest1 due to org.apache.kafka.common.errors.LeaderNotAvailableException}] for topic [ncytest1]: class org.apache.kafka.common.errors.LeaderNotAvailableException
16/12/16 11:30:51 INFO client.ClientUtils$: Fetching metadata from broker BrokerEndPoint(0,act201,9092) with correlation id 7 for 1 topic(s) Set(ncytest1)
16/12/16 11:30:51 INFO producer.SyncProducer: Connected to act201:9092 for producing
16/12/16 11:30:51 INFO producer.SyncProducer: Disconnecting from act201:9092
16/12/16 11:30:51 WARN producer.BrokerPartitionInfo: Error while fetching metadata [{TopicMetadata for topic ncytest1 ->
No partition metadata for topic ncytest1 due to org.apache.kafka.common.errors.LeaderNotAvailableException}] for topic [ncytest1]: class org.apache.kafka.common.errors.LeaderNotAvailableException
16/12/16 11:30:51 ERROR async.DefaultEventHandler: Failed to collate messages by topic, partition due to: Failed to fetch topic metadata for topic: ncytest1
16/12/16 11:30:51 INFO async.DefaultEventHandler: Back off for 100 ms before retrying send. Remaining retries = 0
16/12/16 11:30:51 INFO client.ClientUtils$: Fetching metadata from broker BrokerEndPoint(3,act204,9092) with correlation id 8 for 1 topic(s) Set(ncytest1)
16/12/16 11:30:51 INFO producer.SyncProducer: Connected to act204:9092 for producing
16/12/16 11:30:51 INFO producer.SyncProducer: Disconnecting from act204:9092
16/12/16 11:30:51 ERROR async.DefaultEventHandler: Failed to send requests for topics ncytest1 with correlation ids in [0,8]
Exception in thread "Thread-10" kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries.
at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:93)
at kafka.producer.Producer.send(Producer.scala:77)
at kafka.javaapi.producer.Producer.send(Producer.scala:33)
at com.surfilter.ip.kafka.producer.KafkaSend.send(KafkaSend.java:51)
at com.surfilter.ip.kafka.producer.KafkaProducer.run(KafkaProducer.java:32)
用java写了个kafka producer程序,启动的时候报错 ,但是topic已经创建成功了,消息发送不了
4 个解决方案
你broker列表传对了没有?别把zookeeper传给producer了。。。
Failed to collate messages by topic, partition due to: Failed to fetch topic metadata for topic: ncytest1
可能集群有问题,
用自带的 脚本(叫啥忘了) 作为生产者发送一些测试数据
在用自带的 kafka.consonle.consumer 消费看是否正常。
猜测可能是集群自身有问题。
"Disconnecting from act201:9092"kafka服务器集群连接不上,kafka主题获取不了。