内容简介: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中配置事务级别与命名查询配置【原创】
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
正则表达式必知必会(修订版)
福达 (Ben Forta) / 杨涛 / 人民邮电出版社 / 2015-1-1 / 29.00元
《正则表达式必知必会》从简单的文本匹配开始,循序渐进地介绍了很多复杂内容,其中包括回溯引用、条件性求值和前后查找,等等。每章都为读者准备了许多简明又实用的示例,有助于全面、系统、快速掌握正则表达式,并运用它们去解决实际问题。正则表达式是一种威力无比强大的武器,几乎在所有的程序设计语言里和计算机平台上都可以用它来完成各种复杂的文本处理工作。而且书中的内容在保持语言和平台中立的同时,还兼顾了各种平台之......一起来看看 《正则表达式必知必会(修订版)》 这本书的介绍吧!