How to run MapReduce program?

0 votes
Hi. I have chosen the Hadoop course from Edureka. I have got the VM for practice. I want to run MapReduce programs and need eclipse for that. Can you please tell me how to install it and the steps to run MapReduce program?
Feb 21 in Big Data Hadoop by Shashi

edited Feb 21 89 views

1 answer to this question.

0 votes

Eclipse is already installed in the Edureka VM. When you start the VM, you will be able to see Eclipse on the Desktop. Double click on it to launch it. 

Here are the steps:

1) Write the program in eclipse. imageIn this program, the package name is co.edureka and the class name is WordCount.

2)Create the jar file of this program and the name of the jar file is WordCount.jar and then uploaded it to FTP on My Lab​

3) Upload the dataset on hdfs. We can do this by first uploading the dataset on FTP and then transferring it to hdfs.

Upload the dataset on FTP:
Transfer it to hdfs by the below command:​

hdfs dfs -put wordcountproblem

4) Now, we have our jar file in FTP (local file system) and our dataset in hdfs. So, now we will execute the hadoop jar command. 

The syntax for hadoop jar command is as below: 

hadoop jar jarfilename.jar packagename.classname inputfilename outputdirectoryname

For our program, we will execute the below hadoop jar command:

hadoop jar WordCount.jar co.edureka.WordCount wordcountproblem WordCountOutput3

5) Check the output with the below command. The syntax to check the output is as below:

hdfs dfs -cat outputdirectoryname/part-r-00000

We will check the output of our program with the below command:

hdfs dfs -cat WordCountOutput3/part-r-00000
answered Feb 21 by Suman

Related Questions In Big Data Hadoop

0 votes
1 answer

How to run mapreduce program in terminal?

You can reference the below steps: Step 1: ...READ MORE

answered Jan 31 in Big Data Hadoop by Srishti
137 views
0 votes
0 answers

How to run Hadoop in Docker containers?

I want to incorporate Hadoop in Docker ...READ MORE

Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 10,490 points
71 views
0 votes
1 answer

How to run example codes of Hadoop Definitive Guide book?

You will find multiple git repositories where ...READ MORE

answered Mar 21, 2018 in Big Data Hadoop by Shubham
• 13,290 points
103 views
0 votes
1 answer

How hadoop mapreduce job is submitted to worker nodes?

Alright, I think you are basically looking ...READ MORE

answered Mar 29, 2018 in Big Data Hadoop by Ashish
• 2,630 points
1,526 views
0 votes
1 answer

Moving files in Hadoop using the Java API?

I would recommend you to use FileSystem.rename(). ...READ MORE

answered Apr 15, 2018 in Big Data Hadoop by Shubham
• 13,290 points
748 views
0 votes
1 answer

Hadoop giving java.io.IOException, in mkdir Java code.

I am not sure about the issue. ...READ MORE

answered May 3, 2018 in Big Data Hadoop by Shubham
• 13,290 points
362 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,490 points
2,302 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,490 points
234 views
0 votes
1 answer

How to run Map Reduce program using Ubuntu terminal?

 I used the following steps to execute it ...READ MORE

answered Aug 7, 2018 in Big Data Hadoop by Neha
• 6,280 points
83 views
0 votes
7 answers

How to run a jar file in hadoop?

I used this command to run my ...READ MORE

answered Dec 10, 2018 in Big Data Hadoop by Dasinto
4,363 views