hadoop知识之fsimage和editlog

fsimage:filesystem image 的简写,文件镜像。

客户端修改文件时候,先写到editlog,成功后才更新内存中的metadata信息。

只有当对文件操作成功的时候,才会写到editlog。

fsimage是文件meta信息的持久化的检查点。



当namenode失败的时候,

文件metadata信息可以通过:加载fsimage文件到内存中,在editlog中应用相应的操作。

(这一操作也是namenode刚启动要干的事情。)


fsimage文件中包含文件metadata信息,不包含文件块位置的信息。

namenode把文件块位置信息存储在内存中,这些位置信息是,在 datanode加入集群的时候,

namenode询问datanode得到的,并且间断的更新。


As described, the edits file would grow without bound. Though this state of affairs
would have no impact on the system while the namenode is running, if the namenode
were restarted, it would take a long time to apply each of the operations in its (very
long) edit log. During this time, the filesystem would be offline, which is generally
undesirable.

The solution is to run the secondary namenode, whose purpose is to produce checkpoints
of the primary’s in-memory filesystem metadata


fsimage与editlog的旅行

图片

 

两个属性配置checkpoint

fs.checkpoint.period in seconds

fs.checkpoint.size in bytes, which it checks
every five minutes.


safe mode下也可以手动,

命令: hadoop dfsadmin -saveNamespace

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值