启动hive,报错 Name node is in safe mode.

在学习过程中,过了几天再启动虚拟机,启动hadoop后再启动别的框架会报错:
Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.server.namenode.Saf
eModeException): Cannot create directory /tmp/hive/root/52105826-b5a2-4aa7-965d-195920589030. Name node is in safe mode.The reported blocks 431 has reached the threshold 0.9990 of total blocks 431. The number of live datanodes 3 has reached the minimum nu
mber 0. In safe mode extension. Safe mode will be turned off automatically in 13 seconds.	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkNameNodeSafeMode(FSNamesystem.java:1364)
	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInt(FSNamesystem.java:4216)
	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesystem.java:4191)
	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.mkdirs(NameNodeRpcServer.java:813)
	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.mkdirs(ClientNamenodeProtocolServerSideTransl
atorPB.java:600)	at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenod
eProtocolProtos.java)

hadoop 处于安全模式,所以需要退出安全模式,一般以如下方法可以解决:

hadoop dfsadmin -safemode leave

  

实在不行还可以用如下方式:

hdfs dfsadmin -safemode leave

  

原文地址:https://www.cnblogs.com/wyh-study/p/12349140.html