【发布时间】:2021-10-17 18:14:44
【问题描述】:
我是 Kafka 的新手,并且遵循 Stephane Maarek 的教程。 我正在尝试为 Kafka 生成数据。我的 Zookeeper 端口是 2181,并且有一个主题:first-topic。
Topic: first-topic TopicId: AiYAVfKyQxm3827NoYI8sw PartitionCount: 3 ReplicationFactor: 1 Configs:
Topic: first-topic Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: first-topic Partition: 1 Leader: 0 Replicas: 0 Isr: 0
Topic: first-topic Partition: 2 Leader: 0 Replicas: 0 Isr: 0
我正在尝试通过命令生成数据:
kafka-console-producer --broker-list 120.0.0.1:9092 --topic first-topic
但我不断收到错误:
[2021-08-15 14:36:27,204] WARN [Producer clientId=console-producer] Bootstrap broker 120.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2021-08-15 14:36:48,373] WARN [Producer clientId=console-producer] Connection to node -1 (/120.0.0.1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2021-08-15 14:37:18,179] ERROR Error when sending message to topic first-topic with key: null, value: 1 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.TimeoutException: Topic first-topic not present in metadata after 60000 ms.
[2021-08-15 14:39:15,333] WARN [Producer clientId=console-producer] Bootstrap broker 120.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
我检查了所有帖子,但它们对我来说没有意义。谁能建议我能做什么?
谢谢。
【问题讨论】:
标签: apache-kafka kafka-producer-api