Wednesday, May 22, 2013

How-to Install & Getting-Started with Apache Hadoop Database for Linux Kubuntu 13.04 Raring Desktop

The Tutorial Show Step-by-Step How-to Install and Getting-Started with Apache Hadoop vanilla in Pseudo-Distributed mode on Linux Kubuntu 13.04 Raring i386/amd64 Desktop.

 

The Guide Describe a System-Wide Installation with Root Privileges but You Can Easily Convert the Procedure to a Local One.

 

The Content and Details are Expressly Reduced to Give Focus Only to the Essentials Instructions and Commands.

Gnome Penguin Hadoop

  1. Download Latest Apache Hadoop Stable Release:

    Apache Hadoop tar.gz
  2. Right-Click on Archive > Open with Ark

    Then Extract Into /tmp

    KDE4 Apache Hadoop tar.gz Extraction
  3. Open Terminal Window
    Linux Kubuntu 12 Open Terminal
  4. Relocate Apache Hadoop Directory
    sudo su
    mv /tmp/hadoop* /usr/local
    ln -s /usr/local/hadoop* /usr/local/hadoop
    mkdir /usr/local/hadoop/tmp
    chown -R <user>:<group> /usr/local/hadoop*
  5. How-to Install Oracle Official Java JDK7 on Ubuntu:

    Install Oracle JDK7 for Kubuntu
  6. Set JAVA_HOME in Hadoop Env File
    nano /usr/local/hadoop/conf/hadoop-env.sh

    Inserts:

    export JAVA_HOME=/usr/lib/jvm/<oracleJdkVersion>

    Ctrl+x to Save & Exit :)

  7. Configuration for Pseudo-Distributed mode
    nano /usr/local/hadoop/conf/core-site.xml

    The Content Should Look Like:

    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    <configuration>
    <property>
    <name>hadoop.tmp.dir</name>
    <value>/usr/local/hadoop/tmp</value>
    </property>
    <property>
    <name>fs.default.name</name>
    <value>hdfs://localhost:8020</value>
    </property>
    </configuration>

    Next:

    nano /usr/local/hadoop/conf/hdfs-site.xml

    The Content Should Look Like:

    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    <configuration>
    <property>
    <name>dfs.replication</name>
    <value>1</value>
    </property>
    <property>
    <!-- specify this so that running 'hadoop namenode -format'
    formats the right dir -->
    <name>dfs.name.dir</name>
    <value>/usr/local/hadoop/cache/hadoop/dfs/name</value>
    </property>
    </configuration>

    Last:

    nano /usr/local/hadoop/conf/mapred-site.xml

    The Content Should Look Like:

    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    <configuration>
    <property>
    <name>mapred.job.tracker</name>
    <value>localhost:8021</value>
    </property>
    </configuration>
  8. SetUp Path & Environment
    su <myuser>
    cd $HOME
    nano .bashrc

    Inserts:

    HADOOP_HOME=/usr/local/hadoop
    export PATH=$PATH:$HADOOP_HOME/bin

    The JAVA_HOME is Set Following Oracle Java JDK6+ Installation Version...

    Then Load New Setup:

    source $HOME/.bashrc
  9. SetUp Needed Local SSH Connection
    sudo su -c "openssh-server"

    Generate SSH Keys to Access:

    ssh-keygen -b 2048 -t rsa
    cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

    Testing Connection:

    ssh 127.0.0.1
  10. Formatting HDFS
    hadoop namenode -format
    Terminal Apache Hadoop HDFS Formatting Succcess
  11. Starting Up Hadoop Database
    start-all.sh
  12. Apache Hadoop Database Quick-Start Guide:

    Hadoop MapReduce Quick-Start