Jeevanantham
Jeevanantham

Reputation: 1032

Hadoop - Input path does not exist

I did set up the hadoop Ubuntu OS, followed all the necessary steps, 1.created the hdfs file system 2.Moved the text files to input directory 3.having privilege to access all the directories. but when run the simple word count example, i got

Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/user/root/input
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:224)

but, input path is valid and even can able view the files in that path from eclipse itself, so plz assist were i am wrong.

attached the screenshot for the reference enter image description here

Upvotes: 2

Views: 11028

Answers (2)

Rajesh Goel
Rajesh Goel

Reputation: 3373

For hadoop-2.2.0 on windows 7, I added the below lines and it solved the issue (NOTE: My Hadoop Home is: C:\MyWork\MyProjects\Hadoop\hadoop-2.2.0)

Configuration conf = new Configuration();

conf.addResource(new Path("C:\MyWork\MyProjects\Hadoop\hadoop-2.2.0\etc\hadoop\core-site.xml"));

conf.addResource(new Path("C:\MyWork\MyProjects\Hadoop\hadoop-2.2.0\etc\hadoop\hdfs-site.xml"));

Upvotes: 1

Tariq
Tariq

Reputation: 34184

Add the following 2 lines in your code :

config.addResource(new Path("/HADOOP_HOME/conf/core-site.xml"));
config.addResource(new Path("/HADOOP_HOME/conf/hdfs-site.xml"));

Your client is looking into the local FS.

Upvotes: 6

Related Questions