Skip to content
Advertisement

Setting up Hadoop in Pseudo-distributed mode in ubuntu

I’m trying to teach myself Hadoop on my laptop. My objective is to get the pseudo distributed mode running.

I’m following the guide from the Apache website to set up Hadoop and HDFS in Ubuntu, but I can’t get it to work. Here are the steps I have followed so far:

1) check Java version:

JavaScript

returns:

JavaScript

2) obtain Hadoop 2.7:

JavaScript

3) link Hadoop to JAVA.

replace

JavaScript

by

JavaScript

in

JavaScript

4) add SSH:

JavaScript

5) add /home/me/hadoop-2.7.3/bin and /home/me/hadoop-2.7.3/sbin to the PATH:

JavaScript

and add:

JavaScript

7) Now, I’m trying to set up the Pseudo-Distributed Operation mode. Still following the instructions, I change /home/me/hadoop-2.7.3/etc/hadoop/core-site.xml by adding

JavaScript

in the <configuration> block and I change /home/me/hadoop-2.7.3/etc/hadoop/hdfs-site.xml by adding

JavaScript

8) Following the instructions, doing:

JavaScript

seems to work (yields Y/N prompt and lot of texts on the screen).

9) start hdfs:

JavaScript

also seems to work (prompts a couple of passwords).

10) Create the folder structure for input. Doing

JavaScript

works. But now, doing

JavaScript

yields:

JavaScript

and

JavaScript

doesn’t show anything;(

Edit:

After reading Arduino Sentinel’s answer, my hdfs-site.xml file is:

JavaScript

and both /home/me/Desktop/work/cv/hadoop/datanode and /home/me/Desktop/work/cv/hadoop/namenode exist.

make sure that /home/me/Desktop/work/cv/hadoop/datanode and /home/me/Desktop/work/cv/hadoop/namenode are empty:

JavaScript

and now doing

hdfs dfs -put /home/me/Desktop/work/cv/hadoop/salaries.csv /user/hduser/input/

does not return an error message and doing:

JavaScript

yields the desired result:

JavaScript

Advertisement

Answer

Your hdfs-site.xml should have dfs.namenode.name.dir and dfs.datanode.data.dir properties that points to a local directory in order name node and datanode to start.

JavaScript
Advertisement