Kafka,超时等待节点分配?

时间:2019-12-01 14:23:03

标签: macos apache-kafka

按照入门指南,我遇到以下错误:

  

org.apache.kafka.common.errors.TimeoutException:等待节点分配超时。    (kafka.admin.TopicCommand $)

我所做的是使用以下命令启动两个服务器:

bin/zookeeper-server-start.sh config/zookeeper.properties

bin/kafka-server-start.sh config/server.properties

,然后执行以下命令获取错误:

bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test

我正在osx Mojave上运行

启动kafka服务器时,我获得以下日志:

” [2019-12-08 17:50:53,929]信息处理会话id:0x10002516aaf0000类型:create cxid:0x2 zxid:0x3 txntype:-1 reqpath:n / a错误路径:/ brokers错误:KeeperErrorCode =适用于/ brokers的NoNode(org.apache.zookeeper.server.PrepRequestProcessor) [2019-12-08 17:50:53,957]信息处理会话ID:0x10002516aaf0000类型:create cxid:0x6 zxid:0x7 txntype:-1 reqpath:n / a错误路径:/ config错误:KeeperErrorCode =用于/ config的NoNode(org.apache.zookeeper.server.PrepRequestProcessor) [2019-12-08 17:50:53,977]信息处理会话ID:0x10002516aaf0000类型:create cxid:0x9 zxid:0xa txntype:-1 reqpath:n / a错误路径:/ admin错误:KeeperErrorCode =用于/ admin的NoNode(org.apache.zookeeper.server.PrepRequestProcessor) [2019-12-08 17:50:54,282]信息在处理sessionid:0x10002516aaf0000类型:create cxid:0x15 zxid:0x15 txntype:-1 reqpath:n / a错误路径:/ cluster Error:KeeperErrorCode =用于/ cluster的NoNode(org.apache.zookeeper.server.PrepRequestProcessor) [2019-12-08 17:50:55,247]信息处理会话id:0x10002516aaf0000类型:multi cxid:0x37 zxid:0x1c txntype:-1 reqpath:n /时,中止了用户级KeeperException异常。错误路径:/ admin / preferred_replica_election错误:KeeperErrorCode =用于/ admin / preferred_replica_election的NoNode(org.apache.zookeeper.server.PrepRequestProcessor)“

1 个答案:

答案 0 :(得分:2)

Apache Kafka 的配置不完整。

对我有用的是更改 server.properties 启用 listeners 参数。

listeners=PLAINTEXT://localhost:9092

请注意示例 disabled 行缺少主机名 (listeners=://localhost:9092)