Apache pig 无法读取Pig中的本地文件

Apache pig 无法读取Pig中的本地文件,apache-pig,Apache Pig,我使用的是Cloudera在“本地模式”下安装的Pig,而不是MapReduce模式。这些脚本在我的笔记本电脑Mac OS上运行良好。但当我尝试在AWS服务器上使用Pig时,Pig无法读取或写入文件 以下是清管器命令: $ pwd /root/ert/test $ pig -x local -l /tmp grunt> pwd file:/root/ert/test grunt> ls file:/root/ert/test/t.pig<r 1> 1697 file

我使用的是Cloudera在“本地模式”下安装的Pig,而不是MapReduce模式。这些脚本在我的笔记本电脑Mac OS上运行良好。但当我尝试在AWS服务器上使用Pig时,Pig无法读取或写入文件

以下是清管器命令:

$ pwd
/root/ert/test

$ pig -x local -l /tmp

grunt> pwd
file:/root/ert/test
grunt> ls
file:/root/ert/test/t.pig<r 1>  1697
file:/root/ert/test/test5.csv<r 1>  330
file:/root/ert/test/test5.pig<r 1>  120
file:/root/ert/test/test5.tsv<r 1>  293

grunt>  testdata    = load 'test5.tsv' as (name:chararray, lob:chararray, date:chararray);
我得到的错误是:

Input(s):
Failed to read data from "file:///root/ert/test/test5.tsv"

Output(s):
Failed to produce result in "file:/tmp/temp-1810274881/tmp1793050127"
我使用yum$yum install Pig和cloudera的CDH5回购安装了just Pig。我在网上读到,这可能是由于“暂存”目录的读写权限造成的,但不知道哪个是暂存目录


猪最初抱怨缺乏HBase。安装HBase后,这些错误停止了,但仍然无法读取输入文件。

我的同事解决了问题。Java消息中隐藏着以下消息:Java.net.UnknownHostException:.local:.local。他创建了/opt/mapr/hostname文件并将主机名存储在那里,还更新了/etc/hosts文件并指定了localhost值。这就解决了问题。

你能展示一下grunt的pwd和ls输出吗?我用你要求的输出更新了我的原始帖子。ls和pwd命令在gruntIs中运行良好。有没有可能pig正在HDFS中查找文件,即使我在进入pig shell时使用了-x local选项?在执行pig-x本地命令时,我看到一条消息:。。。。[main]INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine-连接到hadoop文件系统的位置:file://。。。。。
Input(s):
Failed to read data from "file:///root/ert/test/test5.tsv"

Output(s):
Failed to produce result in "file:/tmp/temp-1810274881/tmp1793050127"