Escolar Documentos
Profissional Documentos
Cultura Documentos
Reference
http://www.michaelnoll.com/tutorials/running-hadoop-onubuntu-linux-single-node-cluster/
Prerequisites
JAVA
How to check
Java version
export JAVA_HOME=/usr/lib/jvm/java-7-openjdki386
Configuring SSH
To securely connecting remote machine
ssh-keygen -t rsa -P ""
Generating public/private rsa key pair.
Enter file in which to save the key (/home/student/.ssh/id_rsa):
Your identification has been saved in /home/student/.ssh/id_rsa.
Your public key has been saved in /home/student/.ssh/id_rsa.pub.
The key fingerprint is:
83:96:7d:15:32:62:7d:85:60:07:0a:0b:02:26:39:1e student@ubuntu
The key's randomart image is:
+--[ RSA 2048]----+
|o+. . . o.*ooo. |
|=E . . + +.+o. |
|... . . .. |
|. + . |
Installing hadoop
Share the hadoop folder from the host
In virtual machine go to
*player-manage-virtual machine settingsoptions sharedfolder-click enable
* Add the folder from the host machine
* In VM, /mnt/hgfs the shared folder is
available.
Installing Hadoop
sudo nano ~/.bashrc
# Set JAVA_HOME (we will also configure JAVA_HOME directly for Hadoop later on)
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
# $ lzohead
/hdfs/path/to/lzop/compressed/file.lzo
#
# Requires installed 'lzop' command.
#
lzohead ()
{ hadoop fs -cat $1 | lzop -dc | head -1000 |
less }
Configuring Hadoop
All the following files will be there in
/usr/student/hadoop
Conf/hadoop-env.sh
Conf/core-site.xml
Conf/mapred-site.xml
Conf/hdfs-site.xml
hadoop-env.sh
# The java implementation to use. Required.
export JAVA_HOME=/usr/lib/jvm/java-7openjdk-i386
# to disable ipv6
export HADOOP_OPTS=Djava.net.preferIPv4Stack=true
Conf/core-site.xml
<property> <name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value> <description>A
base for other temporary directories.</description>
</property> <property>
<name>fs.default.name</name>
<value>hdfs://localhost:54310</value>
<description>The name of the default file system. A
URI whose scheme and authority determine the
FileSystem implementation. The uri's scheme
determines the config property (fs.SCHEME.impl)
naming the FileSystem implementation class. The uri's
authority is used to determine the host, port, etc. for a
filesystem.</description> </property>
conf/mapred-site.xml
<property>
<name>mapred.job.tracker</name>
<value>localhost:54311</value>
<description>The host and port that the
MapReduce job tracker runs at. If "local", then
jobs are run in-process as a single map and
reduce task. </description> </property>
conf/hdfs-site.xml
<property> <name>dfs.replication</name>
<value>1</value> <description>Default block
replication. The actual number of replications
can be specified when the file is created. The
default is used if replication is not specified in
create time. </description> </property>