Skip to main content

Posts

Showing posts with the label HDFS

Running a MapReduce Job (WordCount) on Hadoop Single-Node Cluster

In the previous post we’ve seen how to install Hadoop on Ubuntu, now it’s time to run our first Hadoop MapReduce job. We will use the WordCount example job which reads text files and counts how often words occur. The input is text files and the output is text files, each line of which contains a word and the count of how often it occurred, separated by a tab. 1. Download example input data We will use three ebooks from Project Gutenberg for this example: The Outline of Science, Vol. 1 (of 4) by J. Arthur Thomson The Notebooks of Leonardo Da Vinci Ulysses by James Joyce Download each ebook and store the files in a local temporary directory of choice, for example ‘/tmp/gutenberg’. Now we have tochange the file ownership to hduser . Open a terminal and run: 1 sudo chown –R hduser:hadoop /tmp/gutenberg 2. Restart the Hadoop cluster Open a new terminal and restart your Hadoop cluster if it’s not running already 1 su - hduser 2 /usr/local/hadoop/bin/sta...

How to Install Hadoop-1.2.1 (Single-Node Cluster) on Ubuntu-12.04, with JDK 8

In this DIY we will see how to set up a single-node Hadoop cluster backed by the Hadoop Distributed File System (HDFS), running on Ubuntu-12.04. The main goal of this tutorial is to get a simple Hadoop installation up and running so that you can play around with the software and learn more about it. This tutorial has been tested with the following software versions: Ubuntu -12.04 (LTS) Hadoop- 1.2.1, released Aug, 2013 JDK- 8 update 5 Step 1: Prerequisites 1. Download Hadoop Hadoop-1.2.1 can be downloaded from here . Select a mirror, then select 'hadoop-1.2.1/' directory and download hadoop-1.2.1.tar.gz . I assume you have downloaded it into your '/home/ user_name /Downloads' directory. 2. Install JDK 8 Hadoop requires a working Java installation. So, open up a terminal and run the following 1 sudo add-apt-repository ppa:webupd8team/java 2 sudo apt-get update && sudo apt-get install oracle-java8-installer It will take some time to dow...