我正在尝试使用以下命令将本地计算机上的 csv 文件中的数据加载到在 Hive 上创建的测试数据库中
LOAD DATA LOCAL INPATH 'bdata/tx/TX_2012.csv'
INTO TABLE testdb PARTITION(dt='08-09-2012');
但是,我不断收到以下错误:
Copying file: file:/root/business-data/sc_sd_tn_tx_ut/TX_6_17_2012.csv
Failed with exception java.io.IOException: File /tmp/hive-root/hive_2012-08-09_13-21- 49_208_3491106775735913267/-ext-10000/TX_6_17_2012.csv could only be replicated to 0 nodes, instead of 1
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1558)
at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:696)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:563)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1388)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1384)
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:1121)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1382)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.CopyTask
我似乎无法弄清楚是什么导致了这个错误。我什至尝试在单节点和多节点集群上重新安装和重新配置 Hive,但仍然遇到相同的错误。谁能解释错误是什么并指出我正确的方向?
注意:我使用的是 Hadoop 1.0.3 和 Hive-0.8.1,并按照以下教程进行安装和配置:
https://cwiki.apache.org/confluence/display/Hive/GettingStarted
http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/