启动kafka时失败,ERROR [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)

博静玉歌 发表于: 2018-11-10   最后更新时间: 2021-09-06 19:53:14   12,876 游览

各位好,本人启动kafka时失败,具体报错如下:

[2018-11-10 01:48:31,591] ERROR [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
java.lang.OutOfMemoryError: Java heap space
    at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
    at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
    at kafka.log.SkimpyOffsetMap.<init>(OffsetMap.scala:45)
    at kafka.log.LogCleaner$CleanerThread.<init>(LogCleaner.scala:270)
    at kafka.log.LogCleaner$$anonfun$startup$1.apply$mcVI$sp(LogCleaner.scala:142)
    at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160)
    at kafka.log.LogCleaner.startup(LogCleaner.scala:141)
    at kafka.log.LogManager.startup(LogManager.scala:416)
    at kafka.server.KafkaServer.startup(KafkaServer.scala:238)
    at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:38)
    at kafka.Kafka$.main(Kafka.scala:75)
    at kafka.Kafka.main(Kafka.scala)
[2018-11-10 01:48:31,593] INFO [KafkaServer id=0] shutting down (kafka.server.KafkaServer)
[2018-11-10 01:48:31,597] INFO Shutting down. (kafka.log.LogManager)
[2018-11-10 01:48:31,615] INFO Shutdown complete. (kafka.log.LogManager)
[2018-11-10 01:48:31,616] INFO [ZooKeeperClient] Closing. (kafka.zookeeper.ZooKeeperClient)
[2018-11-10 01:48:31,619] INFO Session: 0x10001024f3e0000 closed (org.apache.zookeeper.ZooKeeper)
[2018-11-10 01:48:31,621] INFO EventThread shut down for session: 0x10001024f3e0000 (org.apache.zookeeper.ClientCnxn)
[2018-11-10 01:48:31,621] INFO [ZooKeeperClient] Closed. (kafka.zookeeper.ZooKeeperClient)
[2018-11-10 01:48:31,622] INFO [ThrottledRequestReaper-Fetch]: Shutting down (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-11-10 01:48:32,486] INFO [ThrottledRequestReaper-Fetch]: Stopped (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-11-10 01:48:32,487] INFO [ThrottledRequestReaper-Fetch]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-11-10 01:48:32,487] INFO [ThrottledRequestReaper-Produce]: Shutting down (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-11-10 01:48:32,498] INFO [ThrottledRequestReaper-Produce]: Stopped (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-11-10 01:48:32,498] INFO [ThrottledRequestReaper-Produce]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-11-10 01:48:32,498] INFO [ThrottledRequestReaper-Request]: Shutting down (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-11-10 01:48:33,490] INFO [ThrottledRequestReaper-Request]: Stopped (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-11-10 01:48:33,490] INFO [ThrottledRequestReaper-Request]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-11-10 01:48:33,496] INFO [KafkaServer id=0] shut down completed (kafka.server.KafkaServer)
[2018-11-10 01:48:33,497] ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
[2018-11-10 01:48:33,498] INFO [KafkaServer id=0] shutting down (kafka.server.KafkaServer)

请问是什么原因?如何解决?

发表于 2018-11-10
添加评论

内存不够了。
参考:https://www.orchome.com/10004

楼主怎么解决的啊,我也遇见这个错误了

你的答案

查看kafka相关的其他问题或提一个您自己的问题