【问题标题】:Specifying other user owned S3 buckets in EMR job flows在 EMR 作业流中指定其他用户拥有的 S3 存储桶
【发布时间】:2013-08-24 05:00:12
【问题描述】:

我正在尝试使用 S3 存储桶作为 Elastic Map Reduce 作业流程的输入数据。 S3 存储桶与 EMR 作业流不属于同一账户。我应该如何以及在何处指定 S3 存储桶凭证以访问相应的 S3 存储桶。我尝试了以下格式:

s3n://<Access Key>:<Secret Key>@<BUCKET>

但它给了我以下错误:

Exception in thread "main" java.lang.IllegalArgumentException: The bucket name parameter must be specified when listing objects in a bucket
at com.amazonaws.services.s3.AmazonS3Client.assertParameterNotNull(AmazonS3Client.java:2381)
at com.amazonaws.services.s3.AmazonS3Client.listObjects(AmazonS3Client.java:444)
at com.amazonaws.services.s3.AmazonS3Client.doesBucketExist(AmazonS3Client.java:785)
at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.ensureBucketExists(Jets3tNativeFileSystemStore.java:80)
at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.initialize(Jets3tNativeFileSystemStore.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:83)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
at org.apache.hadoop.fs.s3native.$Proxy1.initialize(Unknown Source)
at org.apache.hadoop.fs.s3native.NativeS3FileSystem.initialize(NativeS3FileSystem.java:512)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1413)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:68)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1431)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:256)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:187)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.setInputPaths(FileInputFormat.java:352)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.setInputPaths(FileInputFormat.java:321)
at com.inmobi.appengage.emr.mapreduce.TestSession.main(TestSession.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:187)

如何指定相同的内容?

【问题讨论】:

    标签: amazon-web-services amazon-s3 elastic-map-reduce amazon-emr


    【解决方案1】:

    您应该尝试将这些凭据添加到 core-site.xml 文件。您可以在节点中手动添加 s3 凭据,也可以在启动集群时使用 boostrap 操作。

    您可以使用以下方式启动集群:

    ruby elastic-mapreduce --create --alive --plain-output --master-instance-type m1.xlarge --slave-instance-type m1.xlarge --num-instances 11 --name "我的超级集群" --bootstrap-action s3://elasticmapreduce/bootstrap-actions/configure -hadoop --args -c,fs.s3.awsAccessKeyId=,-c,fs.s3.awsSecretAccessKey=

    这应该覆盖 EMR 根据启动集群的帐户放置的默认值。

    【讨论】:

    • args 方式对我不起作用。它说试图执行 /mnt/var/lib/bootstrap-actions/2/configure-hadoop --args -c,fs.s3n.awsAccessKeyId=,-c,fs.s3n.awsSecretAccessKey= 在引导程序日志中并失败并出现以下错误:2013-08-26T08:47:22.715Z INFO 执行以 ret val 255 结束 2013-08-26T08:47:22.716Z 错误执行失败,代码为“255”。在从 JobFlow GUI 配置引导操作时,我在“可选参数”中设置 S3 键选项的另一件事。有没有其他方法可以使它起作用?
    • 登录到你的任何从节点,看看里面的 core-site.xml 文件是否有这些变化?还可以尝试使用 Amazon 提供的 ruby​​ cli 启动集群。
    • 我能够使用 ruby​​ cli 并按照您上面的建议运行它,但我现在收到一个新错误:线程“main”状态代码中的异常:403,AWS 服务:Amazon S3 ,AWS 请求 ID:0504CE5FDBFC1D8B,AWS 错误代码:null,AWS 错误消息:禁止,S3 扩展请求 ID:。你能帮忙吗?
    • 感谢所有帮助。这是因为 IAM 凭证在其他地方被你的建议搞砸了。
    猜你喜欢
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-24
    • 2019-11-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多