MAPREDUCE服务 MRS-内存不足导致HDFS NameNode启动失败:原因分析

时间:2024-08-27 10:23:51

原因分析

  1. 在NameNode运行日志(/var/log/Bigdata/hdfs/nn/hadoop-omm-namenode-XXX.log)中搜索“WARN”,可以看到有大量时间在垃圾回收,如下例中耗时较长63s。
    2017-01-22 14:52:32,641 | WARN  | org.apache.hadoop.util.JvmPauseMonitor$Monitor@1b39fd82 | Detected pause in JVM or host machine (eg GC): pause of approximately 63750ms
    GC pool 'ParNew' had collection(s): count=1 time=0ms
    GC pool 'ConcurrentMarkSweep' had collection(s): count=1 time=63924ms | JvmPauseMonitor.java:189
  2. 分析NameNode日志“/var/log/Bigdata/hdfs/nn/hadoop-omm-namendoe-XXX.log”,可以看到NameNode在等待块上报,且总的Block个数过多,如下例中是3629万。
    2017-01-22 14:52:32,641 | INFO  | IPC Server handler 8 on 25000 | STATE* Safe mode ON. 
    The reported blocks 29715437 needs additional 6542184 blocks to reach the threshold 0.9990 of total blocks 36293915.
  3. 打开Manager页面,查看NameNode的GC_OPTS参数配置如下:
    图1 查看NameNode的GC_OPTS参数配置
  4. NameNode内存配置和数据量对应关系参考表1
    表1 NameNode内存配置和数据量对应关系

    文件对象数量

    参考值

    10,000,000

    “-Xms6G -Xmx6G -XX:NewSize=512M -XX:MaxNewSize=512M”

    20,000,000

    “-Xms12G -Xmx12G -XX:NewSize=1G -XX:MaxNewSize=1G”

    50,000,000

    “-Xms32G -Xmx32G -XX:NewSize=2G -XX:MaxNewSize=3G”

    100,000,000

    “-Xms64G -Xmx64G -XX:NewSize=4G -XX:MaxNewSize=6G”

    200,000,000

    “-Xms96G -Xmx96G -XX:NewSize=8G -XX:MaxNewSize=9G”

    300,000,000

    “-Xms164G -Xmx164G -XX:NewSize=12G -XX:MaxNewSize=12G”

support.huaweicloud.com/trouble-mrs/mrs_03_0075.html