Hadoop:HDFS路径中没有文件

时间:2016-09-01 16:28:54

标签: java linux hadoop mapreduce hdfs

我正确设置了Hadoop v.1.2.1的HDFS,SELECT distinct t.user_name , u.display_name , u.lower_parent_name , u.email_address FROM ( SELECT cu.user_name , cu.display_name , cm.lower_parent_name , cu.email_address FROM cwd_user AS cu INNER JOIN cwd_membership AS cm ON cu.directory_id=cm.directory_id AND cu.lower_user_name=cm.lower_child_name AND cm.membership_type='GROUP_USER' WHERE cm.lower_parent_name LIKE 'zz%' AND BINARY cu.user_name = lower( cu.user_name) ) u JOIN cwd_user t ON t.user_name = u.user_name ORDER BY t.user_name; 正确地返回了HDFS中的文件。但是当我想运行以下命令时,我遇到了一个问题:

hadoop fs -ls /user/${username}

这是错误:

username=$USER
hadoop fs -mkdir /user/${username}/project
hadoop fs -put ${inputfilespath}*  /user/${username}/project/
mpJar=${rootPath}mp/src/mp.jar
mp_exec=mp
MR_HADOOPJAR=/opt/hadoop-1.2.1/hadoop-core-1.2.1.jar
MR_MANIFEST=${rootPath}mp/src/manifest.txt
echo "Compiling mp source code.."
javac -classpath $MR_HADOOPJAR ${rootPath}mp/src/*.java
echo "Creating mp jar.."
jar cvfm $mpJar $MR_MANIFEST ${rootPath}mp/src/*.class
export HADOOP_CLASSPATH=$mpJar
hadoop $mp_exec hdfs:/user/${username}/project

但是当我使用Usage: <input directory> There is no files in this path: /user/mohebbi/project Exception in thread "main" java.lang.NullPointerException at mp.main(mp.java:24) 时,它显示文件在此目录中。 (hadoop fs -ls /user/mohebbi/project是用户名)。我很困惑,请帮助我。

另外,我尝试了mohebbi并遇到了同样的错误。

感谢

0 个答案:

没有答案