第一个hadoop项目错误

第一个hadoop项目错误

本文介绍了第一个hadoop项目错误:“输入路径不存在”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了设置一个简单的hadoop项目,我正在学习以下教程:



我的hadoop single node似乎正在正常运行。



使用此代码指定 In 文件夹时:

  FileInputFormat.setInputPaths(conf,new Path(In)); 

我收到此错误:

  13/03/03 22:05:27 ERROR security.UserGroupInformation:PriviledgedActionException as:DEVUSER cause:org.apache.hadoop.mapred.InvalidInputException:输入路径不存在:hdfs:// localhost :9100 / user / DEVUSER / In 

目前 In 文件夹创建于 C:\homedir\hadoop-1.0.4\In



我需要在哪里创建In文件夹,以便它出现在 hdfs:// localhost:9100 / user / DEVUSER / In 中?我需要更新一个xml文件来指向我的本地文件系统上的一个文件夹吗? 你需要上传你的输入首先将文件传输到HDFS文件系统:

  bin / hadoop fs -mkdir In 

会在HDFS中创建一个名为 / user / DEVUSER / In 的目录。

  bin / hadoop fs -put * .txt In 

将从当前目录中将所有 *。txt 文件复制到群集(HDFS)。

您似乎已跳过一章教程。按照它,你的问题应该得到解决。


To setup a simple hadoop project I'm following this tutorial : http://ebiquity.umbc.edu/Tutorials/Hadoop/23%20-%20create%20the%20project.html

My hadoop single node seems to be running correctly.

When I specify the In folder using this code :

FileInputFormat.setInputPaths(conf, new Path("In"));

I receive this error:

13/03/03 22:05:27 ERROR security.UserGroupInformation: PriviledgedActionException as:DEVUSER cause:org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: hdfs://localhost:9100/user/DEVUSER/In

Currently the In folder is created at C:\homedir\hadoop-1.0.4\In

Where do I need to create the "In" folder so that it appears in hdfs://localhost:9100/user/DEVUSER/In? Do I need to update an xml file to point to a folder on my local file system?

解决方案

You need to upload your input files to the HDFS file system first:

bin/hadoop fs -mkdir In

will create a directory named /user/DEVUSER/In in HDFS.

bin/hadoop fs -put *.txt In

will copy all *.txt files from the current directory to the cluster (HDFS).

You seem to have skipped the chapter Upload data from the tutorial. Follow it and your problem should be solved.

这篇关于第一个hadoop项目错误:“输入路径不存在”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 19:42