【发布时间】:2013-03-01 10:56:40
【问题描述】:
上下文是我正在尝试使用我运行的 bash 脚本在 Amazon EMR (Web UI) 上运行流式作业:
-input s3://emrdata/test_data/input -output s3://emrdata/test_data/output -mapper
s3://emrdata/test_data/scripts/mapperScript.sh -reducer NONE
输入目录中包含子目录,这些子目录包含压缩后的数据文件。
mapperScript.sh 失败的相关部分是:
for filename in "$input"/*; do
dir_name=`dirname $filename`
fname=`basename $filename`
echo "$fname">/dev/stderr
modelname=${fname}.model
modelfile=$model_location/$modelname
echo "$modelfile">/dev/stderr
inputfile=$dirname/$fname
echo "$inputfile">/dev/stderr
outputfile=$output/$fname
echo "$outputfile">/dev/stderr
# Will do some processing on the files in the sub-directories here
done # this is the loop for getting input from all sub-directories
基本上,我需要以流模式读取子目录,当我运行它时,hadoop 抱怨说:
2013-03-01 10:41:26,226 ERROR
org.apache.hadoop.security.UserGroupInformation (main):
PriviledgedActionException as:hadoop cause:java.io.IOException: Not a
file: s3://emrdata/test_data/input/data1 2013-03-01 10:41:26,226
ERROR org.apache.hadoop.streaming.StreamJob (main): Error Launching
job : Not a file: s3://emrdata/test_data/input/data1
我知道有人问过类似的问题here
那里的建议是编写自己的 InputFormat。我想知道在编写脚本/给出 EMR 输入的方式上是否遗漏了其他内容,或者用 Java 编写自己的 InputFormat 是否是我唯一的选择。
我也尝试将我的输入与“输入/*”一起提供给 EMR,但没有成功。
【问题讨论】:
-
您是否已经查看了wiki.apache.org/hadoop/AmazonS3 并检查了您的 fs.default.name 等设置?
-
你也试过
input path/*/*吗? -
迈克尔,是的,我确实这样做了。这些设置看起来不错,此外,当没有子目录传递给流脚本时,它们也能完美运行。
-
Amar - 不,没有尝试过。我会这样做并检查它是否有帮助,谢谢!
标签: shell hadoop streaming amazon emr