【问题标题】:Hive No files matching path file and file ExistsHive 没有文件匹配路径文件和文件存在
【发布时间】:2014-02-24 09:44:13
【问题描述】:

我在让 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

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

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

顺便说一句,我在伪分布式模式下运行 hadoop,并且所有三个配置单元守护程序都在本地运行。我用的是 hive-server2 而不是 1。

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

【问题讨论】:

    标签: hadoop hive


    【解决方案1】:

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

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-16
      • 2019-12-16
      • 1970-01-01
      相关资源
      最近更新 更多