Skip to main content

Command Palette

Search for a command to run...

Running Hadoop MapReduce Programs Quiz

Updated
1 min read
Running Hadoop MapReduce Programs Quiz
D

A passionate full-stack developer from @ePlus.DEV

Before starting the Quiz, you will need to complete the setup. If you deleted your container after the previous Hands On activity, go through steps 1. If you did not, go through 5 and 6:

1. Open Docker Desktop

2. Open your terminal shell and go to your big-data-1/hadoop directory

3. Run docker-compose up -d

4. Run docker cp ./mapred-site.xml hadoop-namenode-1:/opt/hadoop/etc/hadoop/mapred-site.xml

5. Run docker cp ./alice.txt hadoop-namenode-1:/opt/hadoop/alice.txt to copy Alice in Wonderland into the container.

6. Run docker exec -it hadoop-namenode-1 /bin/bash to open the containers shell.

7. Create the HDFS user directory hdfs dfs -mkdir -p /user/hadoop


  1. Run wordcount on the alice.txt file. This can be done by using hadoop commands. Remember to place the file into the HDFS. How many times does the word Cheshire occur? (Do not include the word 'Cheshire with an apostrophe. The string -->'Cheshire<-- does not count)

    Enter a number: 6

  2. The set of example MapReduce applications includes wordmedian, which computes the median length of words in a text file. If you run wordmedian using alice.txt as input, what is the median word length?

    Note that wordmedian prints the median length to the terminal at the end of the MapReduce job; the output file does not contain the median length.

    Enter a number: 4


Tip & Tricks

Part 1 of 50

Quick and practical tips to help users optimize tasks, improve skills, and solve common problems effectively across various areas like tech, lifestyle, productivity, and more.

More from this blog

E

ePlus.DEV - Exploring Technology with David Nguyen

1231 posts

A passionate full-stack developer from VIETNAM.