4、NameNode启动过程详解

NameNode

  • 内存
  • 本地磁盘
    • fsimage
    • edits

第一次启动HDFS
  1. 格式化HDFS,目的就是生成fsimage
  2. start NameNode,读取fsimage文件
  3. start DataNode,向NameNode注册;block report(块汇报)
  4. create dir /user/hw/tmp -> write [edits]
  5. put files /user/beifeg/tmp(*-site.xml) -> write [edits]
  6. delete file /user/beifeng/tmp/core-site.xml -> write [edits]

第二次启动HDFS
  1. NameNode
    • read [fsimage]
    • read [edits]
    • gen write fsimage [new]
    • gen edits [null]
  2. DataNode
    • 注册
    • block report
  3. create dir /user/beifeng/tmp -> write [edits]
  4. put files /user/beifeg/tmp(*-site.xml) -> write [edits]
  5. delete file /user/beifeng/tmp/core-site.xml -> write [edits]

SecondaryNameNode辅助功能讲解

  • NameNode中的编辑日志文件太大的话如何处理。需要借助SecondaryNameNode.
  • 定期的合并 fsimage+edits ->new fsimage

转载于:https://www.cnblogs.com/Grand-Jon/p/10212091.html

你可能感兴趣的:(4、NameNode启动过程详解)