异常The number of live datanodes 2 has reached the&n

在hive中执行导入数据文件命令时,报错如下:

Running:load data local inpath '/home/hadoop/source/hive-0.12.0/etc/hive/information.log' into table test
java.sql.SQLException: Query returned non-zero code: 40000, cause: FAILED: RuntimeException org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.server.namenode.SafeModeException): Cannot create directory /tmp/hive-root/hive_2014-07-22_01-10-30_712_7012081624354071010-2. Name node is in safe mode.
The reported blocks 0 needs additional 11 blocks to reach the threshold 0.9990 of total blocks 11.
The number of live datanodes 2 has reached the minimum number 0. Safe mode will be turned off automatically once the thresholds have been reached.
  at org.apache.hadoop.hdfs.server.namenode.FSNamesystem. checkNameNodeSafeMode(FSNamesystem.java:1207)
  at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInt(FSNamesystem.java:3590)
  at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesystem.java:3566)
  at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.mkdirs(NameNodeRpcServer.java:754)
  at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolSe rverSideTranslatorPB.mkdirs(ClientNamenodeProtocolSe rverSideTranslatorPB.java:558)
  at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolPr otos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolPr otos.java)
  at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
  at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:928)
  at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2013)
  at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2009)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAs(Subject.java:396)
  at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1556)
  at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2007)
  at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:194)
  at HiveJdbc.main(HiveJdbc.java:64)

解决办法:

可以关闭安全模式

[root@master mapreduce]# hadoop dfsadmin -safemode leave

你可能感兴趣的:(异常The number of live datanodes 2 has reached the&n)