# index

Create hadoop folder:

cd \~/

mkdir hadoop

cd hadoop

Download hadoop binary. In this class, we choose Hadoop 2.7.7 for compatibility with Spark, expand the tar.gz.

wget <https://archive.apache.org/dist/hadoop/common/hadoop-2.7.7/hadoop-2.7.7.tar.gz>

tar -xvzf hadoop-2.7.7.tar.gz

cd hadoop-2.7.7

pwd

/home/bigdata2/hadoop/hadoop-2.7.7

This is the HADOOP\_HOME, in my case, HADOOP\_HOME=/home/bigdata2/hadoop/hadoop-2.7.7

Add below lines in \~/.bashrc file

\## HADOOP env variables

export HADOOP\_HOME=/home/bigdata2/hadoop/hadoop-2.7.7

export HADOOP\_COMMON\_HOME=$HADOOP\_HOME

export HADOOP\_HDFS\_HOME=$HADOOP\_HOME

export HADOOP\_MAPRED\_HOME=$HADOOP\_HOME

export HADOOP\_YARN\_HOME=$HADOOP\_HOME

export HADOOP\_OPTS="-Djava.library.path=$HADOOP\_HOME/lib/native"

export HADOOP\_COMMON\_LIB\_NATIVE\_DIR=$HADOOP\_HOME/lib/native

export PATH=$PATH:$HADOOP\_HOME/sbin:$HADOOP\_HOME/bin

Then run

source \~/.bashrc or log out and log back in
