Hadoop Map-Reduce
Hadoop Map-Reduce
Hadoop Map-Reduce
Objectives
In this lab, we will run the WordCount example with an input text and see how the content of the input file is processed by WordCount.
1. 1
Copied!
1. 1
Copied!
1. cd hadoop-3.2.3
Copied!
5. Check the hadoop command to see if it is setup. This will display the usage documentation for the hadoop script.
1. 1
1. bin/hadoop
Copied!
1. 1
Copied!
7. Run the Map reduce application for wordcount on data.txt and store the output in /user/root/output
1. 1
Copied!
8. Once the word count runs successfully, you can run the following command to see the output file it has generated.
1. 1
1. ls output
Copied!
You should see part-r-00000 with _SUCCESS indicating that the wordcount has been done.
While it is still processing, you may only see ‘_temporary’ listed in the output directory. Wait for a couple of minutes and run the command again till
you see output as shown above.
1. 1
1. cat output/part-r-00000
Copied!
about:blank 1/2
10/5/23, 4:13 PM about:blank
Practice Lab
1. Do a word count on a file with the following content.
1. 1
2. 2
3. 3
1. Italy Venice
2. Italy Pizza
3. Pizza Pasta Gelato
Copied!
1. rm data.txt
Copied!
1. 1
1. rm -rf output
Copied!
Copied!
Author(s)
Lavanya T S
Contributor(s)
Aije Egwaikhide
Changelog
Date Version Changed by Change Description
05-04-2022 1.3 Sourabh Updated Hadoop version
18-01-2022 1.2 Lavanya Changed to single node hadoop
16-07-2021 1.1 Aije Modified multiple areas
11-07-2021 1.0 Lavanya Created lab instructions for Word count using MapReduce
about:blank 2/2