Introduction
Welcome to our cutting-edge Tech City Lab! In this virtual reality setting, you will take on the role of a Virtual Reality Designer tasked with mastering the skills of managing DataNode and NameNode in Hadoop HDFS. The goal of this lab is to provide hands-on experience in effectively managing these key components in a Hadoop cluster.
Determine the Status of DataNode and NameNode
In this step, you will configure and start DataNode and NameNode services in the Hadoop environment.
Open a terminal and use the command to switch to the
hadoopuser:su - hadoopIf the
NameNodeandDataNodeservices are not running, start them using the following commands:/home/hadoop/hadoop/sbin/start-dfs.shUse the
jpscommand to check if theNameNodeandDataNodeservices are running:jpsExpected output:
hadoop:~/ $ jps 2992 ResourceManager 2406 NameNode 2807 SecondaryNameNode 2556 DataNode 3133 NodeManager 4462 Jps
Managing DataNode Storage
In this step, you will inspect and manage DataNode storage space.
Check the available storage space on the DataNode:
hdfs dfsadmin -reportRemove a specific file from the DataNode:
hdfs dfs -rm /user/hadoop/testfile.txtIf you receive an error message:
rm: Cannot delete /user/hadoop/testfile.txt. Name node is in safe mode.That because HDFS is just started and it is in safe mode. Just wait for a few seconds and
try again.
NameNode Monitoring
In this step, you will monitor the NameNode to ensure the stability and health of the Hadoop Distributed File System (HDFS) cluster.
Check the status of the HDFS cluster:
hdfs dfsadmin -reportMonitor the overall cluster health:
hdfs fsck /
Summary
In this lab, we focused on hands-on exercises related to the management of DataNode and NameNode in Hadoop HDFS. By following the detailed steps and checkers provided, you gained practical experience in setting up, managing storage, and monitoring the Hadoop cluster components. Have fun exploring the world of Hadoop DataNode and NameNode management!



