我面临一个奇怪的问题,我无法在我的hdfs中看到文件。每当我做hadoop fs -ls
我得到以下错误:
hadoop fs -ls
Warning: $HADOOP_HOME is deprecated.
ls: Cannot access .: No such file or directory.
我可以使用像copyfromlocal等命令但仍然无法在hdfs中看到它们也因为这个问题而无法运行pig脚本。 如果我做了一个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天左右才遇到这个问题。尝试重启集群,重启节点等但仍面临同样的问题。
谢谢,
答案 0 :(得分:8)
你的hadoop没有问题
hadoop fs -ls
没有显示任何输出,因为当前用户的主目录中没有目录或文件(从中执行命令)
请运行第二个命令
hadoop fs -ls /
而不是
hadoop fs -ls /*
这样可以正常工作,并为您提供正确的输出。
答案 1 :(得分:0)
它表明您没有使用您的路径正确设置所有变量。 首先,您需要在hadoop
之前配置java home使用本文来配置hadoop
http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/
并向用户授予您希望安装hadoop的用户的权限。