0

Kafka 以集群模式在 3 个服务器上运行。

testdemo我通过下面的命令行创建了主题( ),

kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic testdemo 

我正在通过以下生产者财产发布数据,

Properties props = new Properties();
props.put("bootstrap.servers", "ip:9003");
props.put("metadata.broker.list", "ip1:9091, ip2:9092, ip3:9093");

props.put("producer.type", "async");
props.put("batch.size", "500");
props.put("compression.codec", "1");
props.put("compression.topic", topicName);
props.put("key.serializer", keySerializer);
props.put("value.serializer", ValueSerializer); 

在主题中发布数据时出现以下错误,

 Error when sending message to topic testdemo with key: null, value: 9 bytes with error: 
 Failed to update metadata after 60000 ms. 
 (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback) 
4

0 回答 0