BDAO
BDAO
BDAO
Date :
Aim
To Download and install Hadoop and understand different Hadoop modes. Startup
scripts, Configuration files.
$ java –version
2. Create Hadoop User and Configure Password-less SSH
$ sudo su – hadoop
2.5 Generate public and private key pairs.
$ ssh-keygen -t rsa
$ ssh localhost
3. Install Apache Hadoop
$ sudo su – hadoop
4. Configure Hadoop
4.1Edit file ~/.bashrc to configure the Hadoop environment variables.
$ sudo nano ~/.bashrc
Add the following lines to the file. Save and close the file.
export HADOOP_HOME=/usr/local/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 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"
$ which javac
$ readlink -f /usr/bin/javac
Add the following lines to the file. Then, close and save the file.
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export HADOOP_CLASSPATH+=" $HADOOP_HOME/lib/*.jar"
$ sudo nano $HADOOP_HOME/etc/hadoop/hadoop-env.sh
5.4 Browse to the hadoop lib directory.
$ cd /usr/local/hadoop/lib
$ hadoop version
5.7 Edit the core-site.xml configuration file to specify the URL for your NameNode. Add the
following lines. Save and close the file.
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://0.0.0.0:9000</value>
</property>
</configuration>
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.name.dir</name>
<value>file:///home/hadoop/hdfs/namenode</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>file:///home/hadoop/hdfs/datanode</value>
</property>
</configuration>
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>
$ sudo su - hadoop
5.13 Validate the Hadoop configuration and format the HDFS NameNode.
$ start-dfs.sh
$ start-yarn.sh
You can access the Hadoop NameNode on your browser via http://server-IP:9870. For
example:
http://127.0.0.2:9870
Result:
The successful completion of these steps ensures that Apache Hadoop is installed,
configured, and running on the Linux system, ready to process and manage big data
workloads