Free Online Certification Courses – Learn Today. Lead Tomorrow. › Forums › Apache Hadoop › What is Safemode in Hadoop?
- This topic has 3 replies, 1 voice, and was last updated 5 years, 7 months ago by DataFlair Team.
-
AuthorPosts
-
-
September 20, 2018 at 5:02 pm #6063DataFlair TeamSpectator
What is Safemode? how to come out of Safemode in Hadoop?
Write the commands to enter and leave Safemode in Hadoop? -
September 20, 2018 at 5:03 pm #6066DataFlair TeamSpectator
Safemode in Apache Hadoop is a maintenance state of NameNode, during which NameNode doesn’t allow any modifications to the file system. In Safemode, HDFS cluster is in read-only and doesn’t replicate or delete Data Blocks.
When NameNode starts:
- It loads the file system namespace from the last saved FsImage into its main memory and the edits log file.
- Merges edits log file on fsimage and results in new file system namespace.
- Then it receives block reports containing information about block location from all datanodes. In SafeMode NameNode performs 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.
To know the status of Safemode, use command:
hadoop dfsadmin –safemode get
To enter Safemode, use command:
bin/hadoop dfsadmin –safemode enter
To come out of Safemode, use command:
hadoop dfsadmin -safemode leave
-
September 20, 2018 at 5:03 pm #6068DataFlair TeamSpectator
Safe mode is a mechanism of preventing modifications when HDFS cluster is unstable, In this mode HDFS remains in the read-only mode preventing deletion, replication of the Data Blocks.
HDFS is a distributed file system, so the data blocks of a file are replicated between different data nodes depending upon the replication factor to ensure data availability in case if any data node goes down. What if all the nodes that holds certain blocks are down?
HDFS has a safety mechanism, in which reaching a certain percentage of unavailable blocks makes the HDFS go to a “safe mode”Status of Safemode :
hadoop dfsadmin –safemode get
To Manually enter Safemode:
hadoop dfsadmin –safemode enter
To Exit Safemode:
hadoop dfsadmin -safemode leave
-
September 20, 2018 at 5:03 pm #6069DataFlair TeamSpectator
Safemode in Apache Hadoop is a maintenance state of NameNode, during which NameNode doesn’t allow any modifications to the file system. In Safemode, HDFS cluster is in read-only and doesn’t replicate or delete Data Blocks.
To come out of/leave safemode :
hdfs dfsadmin -safemode leave
To enter safemode :
hdfs dfsadmin -safemode enter
**hadoop dfsadmin -safemode enter
This command will work and will take you to safemode but just as an update hadoop command is DEPRECATED.
Instead use hdfs command .
-
-
AuthorPosts
- You must be logged in to reply to this topic.