无法使用Hadoop

时间:2017-03-24 16:02:46

标签: amazon-web-services hadoop amazon-s3

我试图使用Hadoop(2.7.3)访问我的S3存储桶,并且我得到以下内容

  

ubuntu @ AWS:〜/ Prototype / hadoop $ ubuntu @ AWS:〜/ Prototype / hadoop $   bin / hadoop fs -ls s3:// [bucket] /

     

17/03/24 15:33:31 WARN util.NativeCodeLoader:无法加载   适用于您平台的native-hadoop库...使用builtin-java类   适用的地方   -ls:致命内部错误com.amazonaws.services.s3.model.AmazonS3Exception:状态代码:400,   AWS服务:Amazon S3,AWS请求ID:1FA2318A386330C0,AWS错误   代码:null,AWS错误消息:错误请求,S3扩展请求ID:   1S7Eq6s9YxUb9bPwyHP73clJvD619LZ2o0jE8VklMAA9jrKXPbvT7CG6nh0zeuluGrzybiPbgRQ =     在   com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:798)     在   com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:421)     在   com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:232)     在   com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3528)     在   com.amazonaws.services.s3.AmazonS3Client.headBucket(AmazonS3Client.java:1031)     在   com.amazonaws.services.s3.AmazonS3Client.doesBucketExist(AmazonS3Client.java:994)     在   org.apache.hadoop.fs.s3a.S3AFileSystem.initialize(S3AFileSystem.java:297)     在   org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2669)     在org.apache.hadoop.fs.FileSystem.access $ 200(FileSystem.java:94)at   org.apache.hadoop.fs.FileSystem $ Cache.getInternal(FileSystem.java:2703)     在org.apache.hadoop.fs.FileSystem $ Cache.get(FileSystem.java:2685)     在org.apache.hadoop.fs.FileSystem.get(FileSystem.java:373)at   org.apache.hadoop.fs.Path.getFileSystem(Path.java:295)at   org.apache.hadoop.fs.shell.PathData.expandAsGlob(PathData.java:325)     在   org.apache.hadoop.fs.shell.Command.expandArgument(Command.java:235)     在   org.apache.hadoop.fs.shell.Command.expandArguments(Command.java:218)     在   org.apache.hadoop.fs.shell.Command.processRawArguments(Command.java:201)     在org.apache.hadoop.fs.shell.Command.run(Command.java:165)at   org.apache.hadoop.fs.FsShell.run(FsShell.java:287)at at   org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)at   org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)at   org.apache.hadoop.fs.FsShell.main(FsShell.java:340)   的ubuntu @ AWS:〜/原型/ hadoop的$

CONF-site.xml中:

<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>s3://[ Bucket ]</value>
    </property>

    <property>
            <name>fs.s3a.endpoint</name>
            <value>s3.eu-central-1.amazonaws.com</value>
    </property>

    <property>
        <name>fs.s3a.access.key</name>
        <value>[ Access Key Id ]</value>
    </property>

    <property>
        <name>fs.s3a.secret.key</name>
        <value>[ Secret Access Key ]</value>
    </property>

    <property>
        <name>fs.s3.awsAccessKeyId</name>
        <value>[ Access Key Id ]</value>
    </property>

    <property>
        <name>fs.s3.awsSecretAccessKey</name>
        <value>[ Secret Access Key ]</value>
    </property>

    <property>
        <name>fs.s3n.awsAccessKeyId</name>
        <value>[ Access Key Id ]</value>
    </property>

    <property>
        <name>fs.s3n.awsSecretAccessKey</name>
        <value>[ Secret Access Key ]</value>
    </property>

    <property>
        <name>fs.s3.impl</name>
        <value>org.apache.hadoop.fs.s3a.S3AFileSystem</value>
    </property>

    <!-- Comma separated list of local directories used to buffer
         large results prior to transmitting them to S3. -->
    <property>
        <name>fs.s3.buffer.dir</name>
        <value>/tmp</value>
    </property>
</configuration>

任何人都知道这个问题是什么?

编辑:存储桶和访问它的虚拟机位于法兰克福。它似乎与https://docs.hortonworks.com/HDPDocuments/HDCloudAWS/HDCloudAWS-1.8.0/bk_hdcloud-aws/content/s3-trouble/index.html类似,但在添加端点后仍然无法正常工作。

1 个答案:

答案 0 :(得分:2)

听起来像V4 auth问题,fs.s3a.endpoint属性应该已修复

时钟问题也可能导致问题。检查Joda时间,确保所有机器都能赶上周末的时钟变换。

尝试抓住Hadoop 2.8.0 RC3,看看问题是否已经消失。如果它仍然存在,那就是在apache列表上寻求帮助的版本。