install hadoop

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Apache Hadoop 3.3.6 Installation on Ubuntu 22.

04
Step 1 : Install Java Development Kit

sudo apt update && sudo apt install openjdk-8-jdk

Step 2 : Verify the Java version

java -version

Step 3 : Install SSH

sudo apt install ssh

Step 4 : Create the hadoop user

sudo adduser hadoop

Step 5 : Switch user

su – hadoop

Step 6 : Configure SSH

ssh-keygen -t rsa

Step 7 : Set permissions

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys


chmod 640 ~/.ssh/authorized_keys

Step 8 : SSH to the localhost

ssh localhost

Step 9 : Switch user

su – hadoop

Step 10 : Install hadoop

• Download hadoop 3.3.6

wget https://dlcdn.apache.org/hadoop/common/hadoop-3.3.6/hadoop-3.3.6.tar.gz

• unzip it to a folder
tar -xvzf hadoop-3.3.6.tar.gz

• Rename the extracted folder


mv hadoop-3.3.6 hadoop

• configure Hadoop and Java Environment Variables


nano ~/.bashrc
Append the below lines to the file
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export HADOOP_HOME=/home/hadoop/hadoop
export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export HADOOP_YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib/native"

• Load the above configuration in the current environment


source ~/.bashrc

• configure JAVA_HOME in hadoop-env.sh file


nano $HADOOP_HOME/etc/hadoop/hadoop-env.sh
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

You might also like