2014-02-20 76 views
2

我面临一个奇怪的问题,我无法在我的hdfs中看到文件。每当我做了hadoop fs -ls我得到以下错误:看不到hdfs,Hadoop shell命令hadoop fs -ls给出错误无法访问

hadoop fs -ls 
Warning: $HADOOP_HOME is deprecated. 

ls: Cannot access .: No such file or directory. 

我可以像使用copyfromlocal等命令,但仍然无法看到他们在HDFS也无法运行脚本猪由于这个问题。 如果我做一个Hadoop FS -ls/*我得到以下错误:

hadoop fs -ls /* 
Warning: $HADOOP_HOME is deprecated. 

Found 1 items 
drwxr-xr-x - hduser hadoop   0 2014-02-14 16:49 /app/hadoop 
ls: Cannot access /bin: No such file or directory. 
ls: Cannot access /boot: No such file or directory. 
ls: Cannot access /Data: No such file or directory. 
ls: Cannot access /dev: No such file or directory. 
ls: Cannot access /etc: No such file or directory. 
Found 1 items 
drwxr-xr-x - hduser hadoop   0 2014-02-19 13:02 /home/hduser 
ls: Cannot access /lib: No such file or directory. 
ls: Cannot access /lib64: No such file or directory. 
ls: Cannot access /lost+found: No such file or directory. 
ls: Cannot access /media: No such file or directory. 
ls: Cannot access /misc: No such file or directory. 
ls: Cannot access /mnt: No such file or directory. 
ls: Cannot access /net: No such file or directory. 
ls: Cannot access /opt: No such file or directory. 
ls: Cannot access /proc: No such file or directory. 
ls: Cannot access /root: No such file or directory. 
ls: Cannot access /sbin: No such file or directory. 
ls: Cannot access /selinux: No such file or directory. 
ls: Cannot access /srv: No such file or directory. 
ls: Cannot access /sys: No such file or directory. 
ls: Cannot access /tftpboot: No such file or directory. 
ls: Cannot access /usr: No such file or directory. 
ls: Cannot access /var: No such file or directory. 
ls: Cannot access /zookeeper.out: No such file or directory. 
ls: Cannot access /zookeeper_server.pid: No such file or directory. 

任何人都可以请让我知道这可能是这里的问题? 我有一个7节点hadoop群集工作正常。我仅在2天左右遇到此问题。已尝试重新启动群集,重新启动节点等,但仍面临同样的问题。

感谢,

回答

8

可能是您的Hadoop没有问题

hadoop fs -ls 

没有显示,因为在当前用户的主目录里面没有的目录或文件(您从中执行命令的输出)

请运行第二命令作为

hadoop fs -ls/

而不是

hadoop fs -ls /* 

这将工作正常,并会给你正确的输出。

+0

真的很有帮助,谢谢。 –

0

以及它表明,你不与你的路径正确设置的所有变量.. 首先你需要你的Hadoop

流这篇文章的Hadoop配置之前配置Java家

http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/ 

并且还向用户授予您希望安装hadoop的用户权限。