Resolve Hadoop Name node is in safe mode

Raymond Tang Raymond Tang 0 1944 0.75 index 5/13/2018

In Safe Mode, the HDFS cluster is read-only. After completion of block replication maintenance activity, the name node leaves safe mode automatically.

If you try to delete files in safe mode, the following exception may raise:

org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.server.namenode.SafeModeException): Cannot delete /user/hadoop/sqoop_test/blogs. Name node is in safe mode.

The above exception occurred because I was using Sqoop to load files into HDFS while deleting existing files.

We can also manually leave safe mode by using the following command:

hadoop@hdp-master:/hadoop> hdfs dfsadmin -safemode leave Safe mode is OFF

hadoop hdfs

Join the Discussion

View or add your thoughts below

Comments