• kafka服务无法启动的原因


    kafka集群中一台服务器kill掉后再启动时报错。

    java.io.IOException: Map failed

    Caused by: java.lang.OutOfMemoryError: Map failed

    [2017-06-01 23:13:20,254] ERROR There was an error in one of the threads during logs loading: java.io.IOException: Map failed (kafka.log.LogManager)
    [2017-06-01 23:13:20,264] FATAL [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
    java.io.IOException: Map failed
        at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:940)
        at kafka.log.AbstractIndex.$anonfun$resize$1(AbstractIndex.scala:111)
        at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:213)
        at kafka.log.AbstractIndex.resize(AbstractIndex.scala:101)
        at kafka.log.Log.loadSegments(Log.scala:281)
        at kafka.log.Log.<init>(Log.scala:116)
        at kafka.log.LogManager.$anonfun$loadLogs$10(LogManager.scala:157)
        at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:57)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        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)
        ... 12 more
    [2017-06-01 23:13:20,289] INFO [Kafka Server 0], shutting down (kafka.server.KafkaServer)
    [2017-06-01 23:13:20,478] INFO [Kafka Server 0], shut down completed (kafka.server.KafkaServer)
    [2017-06-01 23:13:20,480] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
    java.io.IOException: Map failed
        at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:940)
        at kafka.log.AbstractIndex.$anonfun$resize$1(AbstractIndex.scala:111)
        at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:213)
        at kafka.log.AbstractIndex.resize(AbstractIndex.scala:101)
        at kafka.log.Log.loadSegments(Log.scala:281)
        at kafka.log.Log.<init>(Log.scala:116)
        at kafka.log.LogManager.$anonfun$loadLogs$10(LogManager.scala:157)
        at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:57)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        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)
        ... 12 more
    [2017-06-01 23:13:20,494] INFO [Kafka Server 0], shutting down (kafka.server.KafkaServer)

    通过https://stackoverflow.com/questions/43042144/kafka-server-failed-to-start-java-io-ioexception-map-failed得知需要64位JVM。

    现环境是centos6.8 32位+jvm 32位,升级为centos6.8 64位+jvm 64位后成功解决。

  • 相关阅读:
    图像处理检测方法 — SIFT和SURF
    代码题(31)— 有效的括号、括号生成、最长有效括号
    代码题(30)— 二叉搜索树、二叉树的最近公共祖先
    【angularjs】使用angular搭建项目,实现隔行换色
    【css3】nth-child
    【window】Windows10下为PHP安装redis扩展
    【css】3d导航效果
    【angularjs】使用angularjs模拟淘宝首页-淘宝头条滚动效果
    【js】横/纵向无缝滚动
    【angularjs】使用ionic+angular 搭建移动端项目,字体适配
  • 原文地址:https://www.cnblogs.com/hd3013779515/p/6931771.html
Copyright © 2020-2023  润新知