Lab11 B
Lab11 B
LAB-11-A
Timings: 11:30 am - 2:30 pm
Lab Protocols:
1. This Lab Would hold tasks at the end. Cheating would result straight 0
2. Making noise in lab during demonstration would result in immediate termination
of session and start of Tasks.
3. Contact me on email for queries [email protected]
MapReduce for word count problem on Hadoop:
In MapReduce word count example, we find out the frequency of each word. Here, the role
of Mapper is to map the keys to the existing values and the role of Reducer is to aggregate
the keys of common values. So, everything is represented in the form of key-value pair.
Example:
Let’s solve a word count problem using MapReduce on Hadoop.
Step 1: Open Cloudera Quickstart VM.
Step 2: Create a .txt data file inside /home/cloudera directory that will be passed as an input to
MapReduce program. For simplicity purpose, we name it as word_count_data.txt.
You’ll see the following if both; HDFS and YARN services are started successfully.
Note: If the directory already exists, then either create a directory with new name or delete
the existing directory using the following command.
export HADOOP_USER_NAME=hdfs
hdfs dfs -rmr /word_count_map_reduce
List HDFS directory items using the following command.
hdfs dfs -ls /