Hadoop Secondary NameNode

本文解释了Hadoop中SecondaryNameNode(SNN)的角色,并非作为NameNode的故障转移备份,而是定期清理和紧缩文件系统的状态信息,提高NameNode效率。文章详细介绍了NameNode如何使用FsImage和EditLog来维护文件系统的状态信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Due to its unfortunate naming, the Secondary NameNode  (SNN) is sometimes 

confused with a failover backup for NameNode. It most certainly is not. The SNN 

only serves to periodically clean up and tighten the fi lesystem’s state information in 

NameNode, helping NameNode become more effi cient. NameNode manages the 

fi  lesystem’s state information using two fi les,  FsImage  and EditLog . The fi  le FsImage is 

a snapshot of the fi  lesystem at some checkpoint, and EditLog records each incremental 

change ( delta ) to the fi lesystem after that checkpoint. These two fi les can completely 

determine the current state of the fi  lesystem. When you initialize NameNode, it merges 

these two fi les to create a new snapshot. At the end of NameNode’s initialization, 

FsImage will contain the new snapshot and EditLog will be empty. Afterward any 

operation that changes the state of HDFS is appended to EditLog, whereas FsImage will 

remain unchanged. When you shut down NameNode and restart it, the consolidation 

will take place again and make a new snapshot. Note that the two fi les are only for 

retaining the fi  lesystem’s state information while NameNode is not running (either 

intentionally shut down or due to system malfunction ). NameNode keeps in memory 

a constantly maintained copy of the fi lesystem’s state information  to quickly answer 

queries about the fi lesystem 


Usage:hadoop secondarynamenode [-checkpoint [force]] | [-geteditsize] 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值