Replace HDFS form local disk to s3 getting error (org.apache.hadoop.service.AbstractService)

后端 未结 1 462
日久生厌
日久生厌 2020-12-19 05:35

We are trying to setup Cloudera 5.5 where HDFS will be working on s3 only for that we have already configured the necessory properties in Core-site.xml

<         


        
1条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-19 06:06

    The problem is not with the location of the jars.

    The problem is with the setting:

    
        fs.AbstractFileSystem.s3a.impl
        org.apache.hadoop.fs.s3a.S3AFileSystem
        The FileSystem for  S3A Filesystem
    
    

    This setting is not needed. Because of this setting, it is searching for following constructor in S3AFileSystem class and there is no such constructor:

    S3AFileSystem(URI theUri, Configuration conf);
    

    Following exception clearly tells that it is unable to find a constructor for S3AFileSystem with URI and Configuration parameters.

    java.lang.RuntimeException: java.lang.NoSuchMethodException: org.apache.hadoop.fs.s3a.S3AFileSystem.(java.net.URI, org.apache.hadoop.conf.Configuration)
    

    To resolve this problem, remove fs.AbstractFileSystem.s3a.impl setting from core-site.xml. Just having fs.s3a.impl setting in core-site.xml should solve your problem.

    EDIT: org.apache.hadoop.fs.s3a.S3AFileSystem just implements FileSystem.

    Hence, you cannot set value of fs.AbstractFileSystem.s3a.impl to org.apache.hadoop.fs.s3a.S3AFileSystem, since org.apache.hadoop.fs.s3a.S3AFileSystem does not implement AbstractFileSystem.

    I am using Hadoop 2.7.0 and in this version s3A is not exposed as AbstractFileSystem.

    There is JIRA ticket: https://issues.apache.org/jira/browse/HADOOP-11262 to implement the same and the fix is available in Hadoop 2.8.0.

    Assuming, your jar has exposed s3A as AbstractFileSystem, you need to set the following for fs.AbstractFileSystem.s3a.impl:

    
        fs.AbstractFileSystem.s3a.impl
        org.apache.hadoop.fs.s3a.S3A
    
    

    That will solve your problem.

    0 讨论(0)
提交回复
热议问题