hadoop - Hive No files matching path file 和 file Exists

标签 hadoop hive

我在让 hive 工作时遇到了很多麻烦。我正在使用 YARN 运行 CDH4.5,所有这些都是从 Cloudera 的 yum 存储库安装的。我按照他们的说明设置了配置单元,但出于某种原因,它无法识别我本地文件系统上的合法文件。

[msknapp@localhost data]$ pwd
/home/msknapp/data
[msknapp@localhost data]$ ll | grep county_insurance_pp.txt 
-rw-rw-rw- 1 msknapp msknapp  162537 Jan  5 14:58 county_insurance_pp.txt
[msknapp@localhost data]$ sudo -u hive hive
Logging initialized using configuration in file:/etc/hive/conf.dist/hive-log4j.properties
Hive history file=/tmp/hive/hive_job_log_9e8bf55b-7ec8-4b79-be9b-cc2200a33f91_1795256456.txt
hive> describe count_insurance;                                                             
2014-01-08 02:42:59.000 GMT Thread[main,5,main] java.io.FileNotFoundException: derby.log (Permission denied)
----------------------------------------------------------------
2014-01-08 02:42:59.443 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.4.2.0 - (689064): instance a816c00e-0143-6fbb-3f3a-000007a1d270
on database directory /var/lib/hive/metastore/metastore_db  

Database Class Loader started - derby.database.classpath=''
OK
fips    int 
st  string  
stfips  int 
name    string  
a   int 
b   int 
c   int 
d   int 
e   int 
f   int 
total   int 
Time taken: 5.195 seconds
hive> LOAD DATA LOCAL INPATH 'county_insurance_pp.txt' OVERWRITE INTO TABLE count_insurance;
FAILED: SemanticException Line 1:23 Invalid path ''county_insurance_pp.txt'': No files matching path file:/home/msknapp/data/county_insurance_pp.txt

我要加载的文件确实存在。当我在我的加载语句中使用绝对路径时,我得到了同样的异常。

附带说明一下,我仍然不知道为什么它总是给我一个带有权限警告的 derby 日志的 FileNotFoundException。很久以前我去了/var/lib/hive 并做了 'sudo chmod -R 777 ./*',所以权限应该不是问题。

顺便说一句,我在伪分布式模式下运行 hadoop,并让所有三个 hive 守护进程在本地运行。我使用的是 hive-server2 而不是 1。

有人请让我知道我在这里做错了什么,或者如何调试它。

最佳答案

我是小智。我最近遇到了同样的问题。

运行Hadoop 服务器的hive 脚本。如果文件 county_insurance_pp.txt 在 Hadoop 服务器上不存在,则找不到该文件。

在运行脚本之前,您必须将目标文件发送到 Hadoop 服务器。有两种处理方法:

  1. 使用scp
  2. 使用 webhdfs ( http://hadoop.apache.org/docs/r1.0.4/webhdfs.html )

关于hadoop - Hive No files matching path file 和 file Exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20986175/

相关文章:

java - 为什么 hadoop fs 命令无法执行来创建目录?

hadoop - 减少hortonworks hadoop中的ram大小时出错

hadoop - 配置单元/DynamoDB 错误 "Could not find column mapping for column"

hadoop - Cloudera Hive,Horton Works Hive和MapR Hive之间的区别?

hadoop - 使用Sqoop导入时如何使用指定的Hive数据库

hadoop - hive 日历日到儒略日期

hadoop - HBase start-hbase.sh在第二个节点上失败

hadoop - HBase master 未运行异常

linux - HDFS 是如何同时向下层本地文件系统写入多个文件的呢?

hive - 为Hive MR作业配置定界符