Installing Hadoop on Ubuntu

This is what I did to set up Hadoop on my Ubuntu machine.

  1. Install the Java Development Kit.
    $ sudo apt-get install default-jdk
  2. Download the latest release of Hadoop here.
  3. Unpack the archive.
    $ tar -xvf hadoop-2.8.0.tar.gz
  4. Move the resulting folder.
    $ sudo mv hadoop-2.8.0 /usr/local/hadoop
  5. Find the location of the Java package.
    $ readlink -f /usr/bin/java | sed "s#bin/java##"
    /usr/lib/jvm/java-8-openjdk-amd64/jre/
  6. Edit the Hadoop configuration file at /usr/local/hadoop/etc/hadoop/hadoop-env.sh and set JAVA_HOME.
    export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/
  7. Test.
    $ /usr/local/hadoop/bin/hadoop version

If the final command returns some information about Hadoop then the installation was successful.