Saturday 2 January 2016

Hadoop: Safemode of Namenode

Safemode is the maintenance state of Namenode. During this state, Namenode is a read-only mode for the HDFS cluster, where it does not allow any modifications to file system or blocks.

During start up the NameNode loads the file system state from the fsimage and the edits log file. It then waits for DataNodes to report their blocks so that it does not prematurely start replicating the blocks though enough replicas already exist in the cluster. During this time NameNode stays in Safemode. NameNode leaves Safemode automatically after the DataNodes have reported that most file system blocks are available

Administrators can manually enter/leave from safemode.

How to enter safemode
Use “hdfs dfsadmin -safemode enter” to enter into safemode.

$ hdfs dfsadmin -safemode enter
Safe mode is ON

During safemode, Namenode won’t allow any write/delete operations on HDFS.

$ hadoop fs -rmdir /user/harikrishna_gurram/dir2
rmdir: Cannot delete /user/harikrishna_gurram/dir2. Name node is in safe mode

How to leave safemode
Use “hdfs dfsadmin -safemode leave” to leave from safemode.

$ hdfs dfsadmin -safemode leave
Safe mode is OFF





Previous                                                 Next                                                 Home

No comments:

Post a Comment