How to Run Hadoop wordcount MapReduce Example on Windows 10

Muhammad Bilal Yar edited this page Jul 20, 2017 · 2 revisions


  1. Download MapReduceClient.jar (Link:
  2. Download Input_file.txt (Link:

Place both files in "C:/"

Hadoop Operation

  1. Open cmd in Administrative mode and move to "C:/Hadoop-2.8.0/sbin" and start cluster

start all

  1. Create an input directory in HDFS.
hadoop fs -mkdir /input_dir
  1. Copy the input text file named input_file.txt in the input directory (input_dir)of HDFS.
hadoop fs -put C:/input_file.txt /input_dir
  1. Verify input_file.txt available in HDFS input directory (input_dir).
hadoop fs -ls /input_dir/


  1. Verify content of the copied file.
hadoop dfs -cat /input_dir/input_file.txt


  1. Run MapReduceClient.jar and also provide input and out directories.
hadoop jar C:/MapReduceClient.jar wordcount /input_dir /output_dir


  1. Verify content for generated output file.
hadoop dfs -cat /output_dir/*


Some Other usefull commands

To leave Safe mode

hadoop dfsadmin –safemode leave

To Delete file from HDFS directory

hadoop fs -rm -r /iutput_dir/input_file.txt

To Delete directory from HDFS directory

hadoop fs -rm -r /iutput_dir


You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.