Check the hadoop services status. Below datanode service is not running

hdoop@hadoop:~$ jps
2258 ResourceManager
1730 NameNode
2038 SecondaryNameNode
2391 NodeManager
2735 Jps

go to core-site.xml and check the path of tmp directory. We need to remove and create same directory

hdoop@hadoop:~/hadoop-3.2.1/etc/hadoop$ pwd

        <description>A base for other temporary directories.</description>
        <description>The name of the default file system></description>

rm -rf /home/hdoop/tmpdata

mkdir -p /home/hdoop/tmpdata

open hdfs-site.xml and remove datanode and namenode directory

vi hdfs-site.xml

rm -rf /home/hdoop/dfsdata/namenode
rm -rf /home/hdoop/dfsdata/datanode/

mkdir -p /home/hdoop/dfsdata/namenode
mkdir -p /home/hdoop/dfsdata/datanode/

Format namenode and start all services. You will find datanode there

hadoop namenode -format

hdoop@hadoop:~/hadoop-3.2.1/etc/hadoop$ jps
4064 SecondaryNameNode
3729 NameNode
4264 ResourceManager
3866 DataNode
4717 Jps
4398 NodeManager

Follow me

Contact us for Training/ Job Support

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.