由于以下错误,我无法启动Kafka服务器。
java.io.IOException: Map failed
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:940)
at kafka.log.AbstractIndex.<init>(AbstractIndex.scala:61)
at kafka.log.TimeIndex.<init>(TimeIndex.scala:55)
at kafka.log.LogSegment.<init>(LogSegment.scala:73)
at kafka.log.Log.loadSegments(Log.scala:267)
at kafka.log.Log.<init>(Log.scala:116)
at kafka.log.LogManager$$anonfun$createLog$1.apply(LogManager.scala:365)
at kafka.log.LogManager$$anonfun$createLog$1.apply(LogManager.scala:361)
at scala.Option.getOrElse(Option.scala:121)
at kafka.log.LogManager.createLog(LogManager.scala:361)
at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:109)
at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:106)
at kafka.utils.Pool.getAndMaybePut(Pool.scala:70)
at kafka.cluster.Partition.getOrCreateReplica(Partition.scala:105)
at kafka.cluster.Partition$$anonfun$4$$anonfun$apply$3.apply(Partition.scala:166)
at kafka.cluster.Partition$$anonfun$4$$anonfun$apply$3.apply(Partition.scala:166)
at scala.collection.mutable.HashSet.foreach(HashSet.scala:78)
at kafka.cluster.Partition$$anonfun$4.apply(Partition.scala:166)
at kafka.cluster.Partition$$anonfun$4.apply(Partition.scala:160)
at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:213)
at kafka.utils.CoreUtils$.inWriteLock(CoreUtils.scala:221)
at kafka.cluster.Partition.makeLeader(Partition.scala:160)
at kafka.server.ReplicaManager$$anonfun$makeLeaders$4.apply(ReplicaManager.scala:754)
at kafka.server.ReplicaManager$$anonfun$makeLeaders$4.apply(ReplicaManager.scala:753)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:230)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:99)
at kafka.server.ReplicaManager.makeLeaders(ReplicaManager.scala:753)
at kafka.server.ReplicaManager.becomeLeaderOrFollower(ReplicaManager.scala:698)
at kafka.server.KafkaApis.handleLeaderAndIsrRequest(KafkaApis.scala:148)
at kafka.server.KafkaApis.handle(KafkaApis.scala:84)
at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:62)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:937)
... 34 more
尝试了以下选项,但没有用。请帮忙。
将操作系统从32位升级到64位。
将Java堆大小增加到1 GB。
卸载并重新安装Apache Kafka。