How to Install HDFS on Elementary OS Latest

Hadoop Distributed File System (HDFS) is a distributed file system designed to run on commodity hardware. It is part of the Apache Hadoop project and is used by many big data applications as a primary storage layer. In this tutorial, you will learn how to install HDFS, which is available from http://hadoop.apache.org/, on Elementary OS Latest.
Prerequisites:
- Elementary OS Latest installed.
- Java 8 or higher installed.
- A user account with sudo privileges.
Steps:
Open Terminal and update the package list:
sudo apt updateInstall SSH client:
sudo apt install sshDownload the Hadoop installation file:
wget https://downloads.apache.org/hadoop/common/hadoop-3.3.1/hadoop-3.3.1.tar.gzExtract the downloaded file:
tar -xvf hadoop-3.3.1.tar.gzMove the extracted folder to
/usr/local/directory:sudo mv hadoop-3.3.1 /usr/local/hadoopSet the
JAVA_HOMEenvironment variable:export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64Append the following lines to the end of the
~/.bashrcfile:export HADOOP_HOME=/usr/local/hadoop export PATH=$PATH:$HADOOP_HOME/binReload the
~/.bashrcfile:source ~/.bashrcEdit the
hadoop-env.shfile:sudo nano /usr/local/hadoop/etc/hadoop/hadoop-env.shFind the line that starts with
export JAVA_HOMEand update it with the following path:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Save and Close the file.
Edit the
core-site.xmlfile:
sudo nano /usr/local/hadoop/etc/hadoop/core-site.xml
- Add the following configuration to the file:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
Save and Close the file.
Edit the
hdfs-site.xmlfile:
sudo nano /usr/local/hadoop/etc/hadoop/hdfs-site.xml
- Add the following configuration to the file:
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/usr/local/hadoop/hadoop_data/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/usr/local/hadoop/hadoop_data/hdfs/datanode</value>
</property>
</configuration>
Save and Close the file.
Format the HDFS file system:
hdfs namenode -format
- Start the HDFS service:
/usr/local/hadoop/sbin/start-dfs.sh
- Verify the HDFS installation:
hdfs dfs -ls /
This will show you the contents of the root directory in the HDFS file system.
Congratulations! You have successfully installed and verified HDFS on Elementary OS Latest. Now you can use HDFS to store and process big data on your system.