Hadoop \ HDFS:“没有这样的文件或目录”

时间:2013-12-22 04:45:50

标签: hadoop hdfs

我使用本教程在一台计算机上安装了Hadoop 2.2:http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/

一些细节有所改变 - 例如,我使用java 8,/ hadoop root dir等用户,SSH,配置密钥 - 相同。

Namenode已成功格式化:

13/12/22 05:42:31 INFO common.Storage: Storage directory /hadoop/tmp/dfs/name has been successfully formatted.
13/12/22 05:42:31 INFO namenode.FSImage: Saving image file /hadoop/tmp/dfs/name/current/fsimage.ckpt_0000000000000000000 using no compression
13/12/22 05:42:32 INFO namenode.FSImage: Image file /hadoop/tmp/dfs/name/current/fsimage.ckpt_0000000000000000000 of size 198 bytes saved in 0 seconds.
13/12/22 05:42:32 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
13/12/22 05:42:32 INFO util.ExitUtil: Exiting with status 0
13/12/22 05:42:32 INFO namenode.NameNode: SHUTDOWN_MSG: 

然而,'mkdir'并非“命令”都没有起作用:

$ /hadoop/hadoop/bin/hadoop fs -ls
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /hadoop/hadoop-2.2.0/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
13/12/22 05:39:33 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
ls: `.': No such file or directory

感谢任何帮助。

4 个答案:

答案 0 :(得分:11)

尝试

hadoop fs -ls /

在hadoop 2.4上测试

答案 1 :(得分:11)

在Hadoop 2.4中

hdfs dfs -mkdir /input
hdfs dfs -ls /

答案 2 :(得分:2)

我已经验证了这在Hadoop 2.5中有用

hdfs dfs -mkdir /input

(其中/input是HDFS目录)

答案 3 :(得分:2)

在我的案子中工作:     首先通过以下方式获取hadoop安装路径:

echo ${HADOOP_INSTALL} //in my case output is : `/user/local/hadoop`

然后在你的hadoop安装路径上创建目录,如果你知道你的hadoop安装目录忽略上面的命令

hadoop fs -mkdir -p /user/local/hadoop/your_directory

这里hadoop是目录

在hadoop 2.4上测试