0

Command

create database IF NOT EXISTS emp;

Error

FAILED: Error in metadata: MetaException(message:Got exception: org.apache.hadoop.ipc.RemoteException org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/hive/warehouse/emp.db. Name node is in safe mode.
The ratio of reported blocks 0.9091 has not reached the threshold 0.9990. Safe mode will be turned off automatically.
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInternal(FSNamesystem.java:2055)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesystem.java:2029)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.mkdirs(NameNode.java:817)
Ambrish
  • 3,627
  • 2
  • 27
  • 42
valli n
  • 55
  • 6
  • 1
    run # sudo -u hdfs hdfs dfsadmin -safemode leave and recreate ... – sandeep rawat Oct 14 '16 at 04:26
  • Possible duplicate of [Setting fs.default.name in core-site.xml Sets HDFS to Safemode](http://stackoverflow.com/questions/19412328/setting-fs-default-name-in-core-site-xml-sets-hdfs-to-safemode) – Ambrish Oct 14 '16 at 06:32

1 Answers1

0

It seems your namenode is in safe mode.

If your cluster don't have enough space in datanode to store data, namenode may goes to safemode.

When namenode is in safemode, you cannot do any write operation on the cluster. During safemode, HDFS cluster is in read only mode and doesn't allow any changes to the file system.

To leave from safemode, run

hdfs dfsadmin -safemode leave

Similar questions

Name node is in safe mode. Not able to leave

Name node is in safe mode

rmr: Cannot delete /output. Name node is in safe mode

Community
  • 1
  • 1
Kumar
  • 3,782
  • 4
  • 39
  • 87