2

I am trying to delete a folder in my Cosmos account, but I get the SafeModeException:

# hadoop fs -rmr /home/<user>/input

rmr: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot delete /user/<user>/input. Name node is in safe mode

nichel
  • 51
  • 2

1 Answers1

1

During start up Namenode loads the filesystem state from fsimage and 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. A Safemode for Namenode is essentially a read-only mode for the HDFS cluster, where it does not allow any modifications to filesystem or blocks. And it takes some time to do above operations and after that it comes out of same node.

If still that doesn't happen or you want the namenode to leave safe mode then give

hadoop dfsadmin -safemode leave
Vignesh I
  • 2,211
  • 2
  • 20
  • 40
  • 1
    I have not superuser privilege. – nichel Oct 07 '15 at 09:04
  • This requires a "hdfs" user privilege usually the super user in hadoop. Are the daemons restarted or just started, usually once everything from fsimage created by the secondary name node is updated in the namenode it should get out of the same mode. However the time it takes depends on the information built in the fsimage between the restarts. – Vignesh I Oct 07 '15 at 09:11
  • The cluster automatically entered in safe mode for a while. This is currently fixed. – frb Oct 08 '15 at 08:11