# Hadoop setup

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://george-jen.gitbook.io/data-science-and-apache-spark/hadoop-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
