0 votes
in Hadoop by
What is Safemode in Hadoop?

1 Answer

0 votes
by

Safemode in Apache Hadoop is a maintenance state of NameNode. During which NameNode doesn’t allow any modifications to the file system. During Safemode, HDFS cluster is in read-only and doesn’t replicate or delete blocks. At the startup of NameNode:

1) It loads the file system namespace from the last saved FsImage into its main memory and the edits log file.

2) Merges edits log file on FsImage and results in new file system namespace.

3) Then it receives block reports containing information about block location from all datanodes.

In SafeMode NameNode perform a collection of block reports from datanodes. NameNode enters safemode automatically during its start up. NameNode leaves Safemode after the DataNodes have reported that most blocks are available. Use the command:

1) hadoop dfsadmin –safemode get: To know the status of Safemode

2) bin/hadoop dfsadmin –safemode enter: To enter Safemode

3) hadoop dfsadmin -safemode leave: To come out of Safemode

4) NameNode front page shows whether safemode is on or off.

🔗Source: Hadoop Interview Questions and Answers

Related questions

+1 vote
asked Jun 21, 2023 in Hadoop by sharadyadav1986
0 votes
asked Jun 18, 2023 in Hadoop by Robindeniel
...