mkdir: Cannot create directory /file. Name node is in safe mode.

刚刚在hadoop想创建一个目录的时候,发现报错了

具体信息如下:

[hadoop@mini1 hadoop-2.6.4]$ hadoop fs -mkdir /file
mkdir: Cannot create directory /file. Name node is in safe mode.

从错误信息可以看到hadoop当前的namenode是处于安全模式。

解决:

[hadoop@mini1 hadoop-2.6.4]$ hadoop  dfsadmin -safemode leave
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Safe mode is OFF

再次执行创建目录的的命令,成功

posted @ 2019-03-09 00:51  yaochunguang  阅读(1763)  评论(0编辑  收藏  举报