FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask

1. 问题

 

hive> LOAD DATA LOCAL INPATH '/root/data/cities.csv' OVERWRITE INTO TABLE cities;
Loading data to table default.cities
Failed with exception Unable to move source file:/root/data/cities.csv to destination hdfs://localhost:9000/user/hive/warehouse/cities/cities.csv
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask

 

 查看Hive Log:

 #vi /tmp/root/hive.log

----------------------------------------
Caused by: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/hive/warehouse/cities/cities.csv could only be replicated to 0 nodes instead of minReplication (=1).  There are 0 datanode(s) running and no node(s) are excluded in this operation.
   at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1549)
   at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:3200)
   at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:641)

 

2. 解决方法

   2.1

   hadoop namenode -format

   2.2

   /usr/local/hadoop/sbin/start-all.sh

 

检查:

hive> LOAD DATA LOCAL INPATH '/root/data/cities.csv' OVERWRITE INTO TABLE cities;
Loading data to table default.cities
Table default.cities stats: [numFiles=1, numRows=0, totalSize=9940080, rawDataSize=0]
OK
Time taken: 0.778 seconds

 

 

 


 

 

 

你可能感兴趣的:(Spark)