找不到密钥:\tmp\kafka logs

oknrviil  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(468)

我已经花了一些精力让Kafka在Windows32(公司发行的笔记本电脑——当然不是我的选择……)上运行。
我成功地创建了一些主题。但在停止/重新启动Kafka之后,它无法重新阅读这些主题。这是启动日志

[2014-05-29 12:26:23,097] INFO [ReplicaFetcherManager on broker 0] Removed fetcher for partitions [vip_ips_alerts,0],[calls,0],[dropped_calls,0],[calls_online,0],[calls_no_phone,0] (kafka.server.ReplicaFetcherManager)
[2014-05-29 12:26:23,106] ERROR [KafkaApi-0] error when handling request Name:LeaderAndIsrRequest;Version:0;Controller:0;ControllerEpoch:4;CorrelationId:5;ClientId:id_0-host_null-port_9092;Leaders:id:0,host:S80035683-SC01.mycompany.com,port:9092;PartitionState:(vip_ips_alerts,0) -> (LeaderAndIsrInfo:(Leader:0,ISR:0,LeaderEpoch:3,ControllerEpoch:4),ReplicationFactor:1),AllReplicas:0),(calls,0) -> (LeaderAndIsrInfo:(Leader:0,ISR:0,LeaderEpoch:1,ControllerEpoch:4),ReplicationFactor:1),AllReplicas:0),(dropped_calls,0) -> (LeaderAndIsrInfo:(Leader:0,ISR:0,LeaderEpoch:3,ControllerEpoch:4),ReplicationFactor:1),AllReplicas:0),(calls_online,0) -> (LeaderAndIsrInfo:(Leader:0,ISR:0,LeaderEpoch:3,ControllerEpoch:4),ReplicationFactor:1),AllReplicas:0),(calls_no_phone,0) -> (LeaderAndIsrInfo:(Leader:0,ISR:0,LeaderEpoch:3,ControllerEpoch:4),ReplicationFactor:1),AllReplicas:0) (kafka.server.KafkaApis)
java.util.NoSuchElementException: key not found: \tmp\kafka-logs
        at scala.collection.MapLike$class.default(MapLike.scala:225)
        at scala.collection.immutable.Map$Map1.default(Map.scala:107)
        at scala.collection.MapLike$class.apply(MapLike.scala:135)
        at scala.collection.immutable.Map$Map1.apply(Map.scala:107)
        at kafka.cluster.Partition.getOrCreateReplica(Partition.scala:91)
        at kafka.cluster.Partition$$anonfun$makeLeader$2.apply(Partition.scala:175)
        at kafka.cluster.Partition$$anonfun$makeLeader$2.apply(Partition.scala:175)
        at scala.collection.immutable.Set$Set1.foreach(Set.scala:86)
        at kafka.cluster.Partition.makeLeader(Partition.scala:175)
        at kafka.server.ReplicaManager$$anonfun$makeLeaders$5.apply(ReplicaManager.scala:305)
        at kafka.server.ReplicaManager$$anonfun$makeLeaders$5.apply(ReplicaManager.scala:304)
        at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
        at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
        at scala.collection.Iterator$class.foreach(Iterator.scala:772)
        at scala.collection.mutable.HashTable$$anon$1.foreach(HashTable.scala:157)
        at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:190)
        at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:45)
        at scala.collection.mutable.HashMap.foreach(HashMap.scala:95)
        at kafka.server.ReplicaManager.makeLeaders(ReplicaManager.scala:304)
        at kafka.server.ReplicaManager.becomeLeaderOrFollower(ReplicaManager.scala:258)
        at kafka.server.KafkaApis.handleLeaderAndIsrRequest(KafkaApis.scala:100)
        at kafka.server.KafkaApis.handle(KafkaApis.scala:72)
        at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:42)
        at java.lang.Thread.run(Thread.java:744)

现在我可以删除/重新创建主题了。事实上,作为调查的一部分,我已经这样做了好几次(例如,为了确保没有Zookeeper腐败),任何关于如何在这个过时的o/s上安装kafka服务器的提示都将不胜感激。

mkh04yzy

mkh04yzy1#

曲解log.dir在unixes和windows中都是Kafka痛苦的巨大根源。
似乎异常是在分区中的以下语句中引起的。replicamanager.highwatermarkcheckpoints(log.dir.getparent)它试图在highwatermarkcheckpoint文件的Map中查找键“\kafka8 tmp\kafka logs”,但它不存在。我们使用log.dirs中的属性值注册密钥。
来源
确保没有后面的斜杠 new java.io.File("\tmp\kafka-logs").getParent 不是扭曲的(我身边没有windows机器,我无法自己解决所有这些向前/向后的斜杠)。

相关问题