我是hadoop的新手.我正在尝试在hdfs中创建一个目录,但我无法创建.
我已登录“hduser”因此我认为/ home / hduser“预先存在为Unix fs.所以我尝试使用下面的命令创建hadoop目录.
[hduser@Virus ~]$hadoop fs -mkdir /home/hduser/mydata/ 14/12/03 15:04:53 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable mkdir: `/home/hduser/mydata/': No such file or directory
在线搜索后,我想到hadoop可能无法理解“/ home / hduser”或者我使用hadoop2,其中mkdir不会像Unix命令“madir -p”那样工作(递归).因此我试图创建“/ mydata”但没有运气.
[hduser@Virus ~]$hadoop fs -mkdir /mydata 14/12/03 15:09:26 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable mkdir: Cannot create directory /mydata. Name node is in safe mode.
我试图离开安全模式,但仍然存在问题.
[hduser@Virus ~]$hdfs dfsadmin -safemode leave 14/12/03 15:09:13 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Safe mode is OFF
我也试过“/ user / mydata”,因为“/ user”是hadoop作为主页的目录.
[hduser@Virus ~]$hadoop fs -mkdir /user/mydata 14/12/03 15:36:20 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable mkdir: Cannot create directory /user/mydata. Name node is in safe mode.
现在如何进一步调试?
要离开安全模式,请尝试以下命令,因为在较新的Hadoop发行版中不推荐使用hadoop dfsadmin -safemode:
原文链接:https://www.f2er.com/bash/383431.htmlhdfs dfsadmin -safemode leave
默认情况下,用户在hdfs中的主目录存在’/ user / hduser’而不是/ home / hduser’.
如果你试图像下面那样直接创建目录,那么它将被创建为’/ user / hduser / sampleDir’.
hadoop fs -mkdir /path/to/be/created