Name node is in safe mode

匿名 (未验证) 提交于 2019-12-03 01:20:02

问题:

I referred to these questions Name node is in safe mode. Not able to leave and SafeModeException : Name node is in safe mode.

the commands i have executed is below

it shows that the safe mode is off but the immediate next command shows name node is in safe mode.

and ls /root is shown below

how to fix it ??

回答1:

Does this happen always Or only at the beginning only when you start hadoop?

If only at the beginning, then wait for sometime in order for NameNode to check if everything is okay before you access hdfs. If it's not leaving safemode after a considerable amount of time, that means there is some imbalance in the filesystem (e.g. under replicated or corrupted blocks). Under replicated blocks will be automatically balanced after some time. For corrupted blocks, you can have a look at output of this command:

hdfs fsck -list-corruptfileblocks

And try to delete corrupted blocks using:

hdfs fsck / -delete

If this does not help, as suggested by @Nishu, use hdfs dfsadmin -safemode leave command to get NameNode out of safemode forcefully. Once you do so, check the output of hdfs dfsadmin -safemode get to confirm that safemode is actually turned off.



回答2:

Try with following command :

[ubuntu~]bin/hdfs dfsadmin -safemode leave 

For newer distribution, hadoop dfsadmin command is deprecated, instead use hdfs dfsadmin command.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!