我正在尝试建立一个琐碎的EMR作业来对存储在s3://__mybucket__/input/
中的大量文本文件进行单词计数。我无法正确添加两个必需的流传输步骤中的第一个(第一步是将输入映射到wordSplitter.py
,使用IdentityReducer
减少到临时存储;第二步是使用/bin/wc/
映射此辅助存储的内容,然后使用IdentityReducer
减少再次)。
这是第一步的(失败)描述:
Status:FAILED
Reason:S3 Service Error.
Log File:s3://aws-logs-209733341386-us-east-1/elasticmapreduce/j-2XC5AT2ZP48FJ/steps/s-1SML7U7CXRDT5/stderr.gz
Details:Exception in thread "main" com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.s3.model.AmazonS3Exception: Bad Request (Service: Amazon S3; Status Code: 400; Error Code: 400 Bad Request; Request ID: 7799087FCAE73457), S3 Extended Request ID: nQYTtW93TXvi1G8U4LLj73V1xyruzre+uSt4KN1zwuIQpwDwa+J8IujOeQMpV5vRHmbuKZLasgs=
JAR location: command-runner.jar
Main class: None
Arguments: hadoop-streaming -files s3://elasticmapreduce/samples/wordcount/wordSplitter.py -mapper wordSplitter.py -reducer org.apache.hadoop.mapred.lib.IdentityReducer -input s3://__mybucket__/input/ -output s3://__mybucket__/output/
Action on failure: Continue
这是发送到hadoop集群的命令:
JAR location : command-runner.jar
Main class : None
Arguments : hadoop-streaming -mapper s3a://elasticmapreduce/samples/wordcount/wordSplitter.py -reducer aggregate -input s3a://__my_bucket__/input/ -output s3a://__my_bucket__/output/
最佳答案
我认为这里的解决方案可能非常简单。
代替s3://
,请使用s3a://
作为您访问存储桶的作业的方案。
请参阅here,不建议使用s3://
方案,它要求所涉及的存储桶不属于Hadoop数据。从上面的文档链接引用: