内容简介:The metadata in Hadoop NN consists of:If you list all files inside your NN workspace directory, you’ll see files include:When NN starts, Hadoop will load fsimage and apply all edit logs, and meanwhile do a lot of consistency checks, it’ll abort if the che
The metadata in Hadoop NN consists of:
- fsimage: contains the complete state of the file system at a point in time
- edit logs: contains each file system change (file creation/deletion/modification) that was made after the most recent fsimage.
If you list all files inside your NN workspace directory, you’ll see files include:
fsimage_0000000000000000000 (fsimage) fsimage_0000000000000000000.md5 edits_0000000000000003414-0000000000000003451 (edit logs, there’re many ones with different name) seen_txid (a separated file contains last seen transaction id)
When NN starts, Hadoop will load fsimage and apply all edit logs, and meanwhile do a lot of consistency checks, it’ll abort if the check failed. Let’s make it happen, I’ll rm edits_0000000000000000001-0000000000000000002 from many of my edit logs in my NN workspace, and then try to sbin/start-dfs.sh, I’ll get error message in log like:
java.io.IOException: There appears to be a gap in the edit log. We expected txid 1, but got txid 3.
So your error message indicates that your edit logs is inconsitent(may be corrupted or maybe some of them are missing). If you just want to play hadoop on your local and don’t care its data, you could simply hadoop namenode -format to re-format it and start from beginning, otherwise you need to recovery your edit logs, from SNN or somewhere you backed up before.
通常在HA配置时,需要先启动journalnode,之后运行:
hdfs namenode -initializeSharedEdits
来把namenode的edits log同步到各个journalnode节点上,journalnode只负责存储edits log,不存FsImage。 经过我的操作并观察发现,这个同步不一定能跟namenode完全一致,不明白这程序同步的依据是什么,同步之后journalnode和namenode的edits_inprogress会不一样,不过也不用担心,也不需要额外操作,过一会儿edits_inprogress就会一致了。 还有一点要说,经过hdfs namenode -initializeSharedEdits命令同步的edits log只是最近的一部分,如果集群之前是非HA的运行过一段时间的,edits log会有很多也许有几千个,那么它只会同步最近一段时间的一部分edits log。
暂时先这些。
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 6、如何获取配置中心的配置
- React降级配置及Ant Design配置
- vscode 配置eslint 开发vue的相关配置
- git commit 规范校验配置和版本发布配置
- hadoop地址配置、内存配置、守护进程设置、环境设置
- 在hibernate中配置事务级别与命名查询配置【原创】
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
响应式Web设计
本·弗莱恩 (Ben Frain) / 奇舞团 / 人民邮电出版社 / 2017-2-1 / CNY 59.00
本书将当前Web 设计中热门的响应式设计技术与HTML5 和CSS3 结合起来,为读者全面深入地讲解了针对各种屏幕大小设计和开发现代网站的各种技术。书中不仅讨论了媒体查询、弹性布局、响应式图片,更将最新和最有用的HTML5 和CSS3 技术一并讲解,是学习最新Web 设计技术不可多得的佳作。一起来看看 《响应式Web设计》 这本书的介绍吧!
URL 编码/解码
URL 编码/解码
HEX HSV 转换工具
HEX HSV 互换工具