<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question access amazon S3 bucket from hdfs in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132082#M34865</link>
    <description>&lt;P&gt;I am trying to connect amazon S3 bucket from hdfs using this command:&lt;/P&gt;&lt;P&gt;$ hadoop fs -ls s3n://&amp;lt;ACCESSKEYID&amp;gt;:&amp;lt;SecretAccessKey&amp;gt;@&amp;lt;bucket-name&amp;gt;/tpt_files/&lt;/P&gt;&lt;P&gt;-ls: Invalid hostname in URI s3n://&amp;lt;ACCESSKEYID&amp;gt;:&amp;lt;SecretAccessKey&amp;gt;@&amp;lt;bucket-name&amp;gt;/tpt_files&lt;/P&gt;&lt;P&gt;Usage: hadoop fs [generic options] -ls [-d] [-h] [-R]
[&amp;lt;path&amp;gt; ...]&lt;/P&gt;&lt;P&gt;My SecretAccessKey includes “/”. Could it be cause of such
behavior? &lt;/P&gt;&lt;P&gt;In the same time I have aws cli installed in this server and
I can access by bucket using aws without any issues using command (AccessKeyId
and SecretAccessKey configured in .aws/credentials)&lt;/P&gt;&lt;P&gt;aws s3 ls s3:// &amp;lt;bucket-name&amp;gt;/tpt_files/&lt;/P&gt;&lt;P&gt;If there any way how to access amazon S3 bucket using Hadoop
command without specifying Keys in core-site.xml. I’d prefer to specify Keys in
command line.&lt;/P&gt;&lt;P&gt;Any suggestions will be very helpful.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Jul 2016 03:52:52 GMT</pubDate>
    <dc:creator>leonidzav</dc:creator>
    <dc:date>2016-07-16T03:52:52Z</dc:date>
    <item>
      <title>access amazon S3 bucket from hdfs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132082#M34865</link>
      <description>&lt;P&gt;I am trying to connect amazon S3 bucket from hdfs using this command:&lt;/P&gt;&lt;P&gt;$ hadoop fs -ls s3n://&amp;lt;ACCESSKEYID&amp;gt;:&amp;lt;SecretAccessKey&amp;gt;@&amp;lt;bucket-name&amp;gt;/tpt_files/&lt;/P&gt;&lt;P&gt;-ls: Invalid hostname in URI s3n://&amp;lt;ACCESSKEYID&amp;gt;:&amp;lt;SecretAccessKey&amp;gt;@&amp;lt;bucket-name&amp;gt;/tpt_files&lt;/P&gt;&lt;P&gt;Usage: hadoop fs [generic options] -ls [-d] [-h] [-R]
[&amp;lt;path&amp;gt; ...]&lt;/P&gt;&lt;P&gt;My SecretAccessKey includes “/”. Could it be cause of such
behavior? &lt;/P&gt;&lt;P&gt;In the same time I have aws cli installed in this server and
I can access by bucket using aws without any issues using command (AccessKeyId
and SecretAccessKey configured in .aws/credentials)&lt;/P&gt;&lt;P&gt;aws s3 ls s3:// &amp;lt;bucket-name&amp;gt;/tpt_files/&lt;/P&gt;&lt;P&gt;If there any way how to access amazon S3 bucket using Hadoop
command without specifying Keys in core-site.xml. I’d prefer to specify Keys in
command line.&lt;/P&gt;&lt;P&gt;Any suggestions will be very helpful.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2016 03:52:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132082#M34865</guid>
      <dc:creator>leonidzav</dc:creator>
      <dc:date>2016-07-16T03:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: access amazon S3 bucket from hdfs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132083#M34866</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/2097/leonidzav.html"&gt;Leonid Zavadskiy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/2097/leonidzav.html"&gt;&lt;/A&gt;You are dealing with this issue: &lt;A href="https://issues.apache.org/jira/browse/HADOOP-3733" target="_blank"&gt;https://issues.apache.org/jira/browse/HADOOP-3733&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As a workaround you can set first the fs.s3.awsAccessKeyId and fs.s3.awsSecretAccessKey properties then the URI would be S3:/mybucket/dest.&lt;/P&gt;&lt;P&gt;Putting things on the command line is not very secure anyway.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2016 05:43:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132083#M34866</guid>
      <dc:creator>cstanca</dc:creator>
      <dc:date>2016-07-16T05:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: access amazon S3 bucket from hdfs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132084#M34867</link>
      <description>&lt;P&gt;Thank you Constantin,&lt;/P&gt;&lt;P&gt;Yes, putting Keys on the command line is not very secure. I am agree with you. But if I will set AccessKeyId and SecureAccessKey in core-site.xml, than all hadoop users will be able to access amazon s3 bucket from hadoop. I am trying to avoid this scenario. &lt;/P&gt;&lt;P&gt;I am playing with putting Keys on command line, but still not successful with it...&lt;/P&gt;&lt;P&gt;Not sure what cause of error - syntax seems OK (now I am trying s3a instead of s3n).&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2016 07:58:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132084#M34867</guid>
      <dc:creator>leonidzav</dc:creator>
      <dc:date>2016-07-16T07:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: access amazon S3 bucket from hdfs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132085#M34868</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Eventually I've found the way how to specify Keys on command line:&lt;/P&gt;&lt;P&gt;hadoop fs -Dfs.s3a.access.key=&amp;lt;AccessKeyId&amp;gt; -Dfs.s3a.secret.key=&amp;lt;SecurityAccessKey&amp;gt; -Dfs.s3a.proxy.host=&amp;lt;proxy_host&amp;gt; -Dfs.s3a.proxy.port=&amp;lt;proxy_port&amp;gt; -ls s3a://&amp;lt;my_bucket/&lt;/P&gt;&lt;P&gt;Thanks to Constantin and kvarakantham for their responses.&lt;/P&gt;&lt;P&gt;. &lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2016 08:20:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132085#M34868</guid>
      <dc:creator>leonidzav</dc:creator>
      <dc:date>2016-07-16T08:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: access amazon S3 bucket from hdfs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132086#M34869</link>
      <description>&lt;P&gt;step1:.add this two property file into core-site.xml file.&lt;/P&gt;&lt;P&gt;&amp;lt;property&amp;gt; &lt;/P&gt;&lt;P&gt;  &amp;lt;name&amp;gt;fs.s3a.access.key&amp;lt;/name&amp;gt;&lt;/P&gt;&lt;P&gt;   &amp;lt;value&amp;gt;your aws IAM user access key&amp;lt;/value&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt; 
&amp;lt;property&amp;gt; &lt;/P&gt;&lt;P&gt;  &amp;lt;name&amp;gt;fs.s3a.secret.key&amp;lt;/name&amp;gt; &lt;/P&gt;&lt;P&gt;  &amp;lt;value&amp;gt;your aws IAM user secret key&amp;lt;/value&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;step2: add s3 bucket endpoint property file into core-site.xml.before you add check s3 bucket region.&lt;/P&gt;&lt;P&gt; for example my bucket in mumbai location:https://s3.ap-south1.amazonaws.com/bucketname/foldername/filename.csv &lt;/P&gt;&lt;P&gt;
&amp;lt;property&amp;gt;&lt;/P&gt;&lt;P&gt;     &amp;lt;name&amp;gt;fs.s3a.endpoint&amp;lt;/name&amp;gt;&lt;/P&gt;&lt;P&gt;   &amp;lt;value&amp;gt; s3,bucket.locatoon &amp;lt;/value&amp;gt;&lt;/P&gt;&lt;P&gt;s3.ap-south1.amazonaws.com&lt;/P&gt;&lt;P&gt;  &amp;lt;/property&amp;gt; &lt;/P&gt;&lt;P&gt;Note:otherwise you get 400 Bad Request WARN s3a.S3AFileSystem:Client: Amazon S3 error 400: 400 Bad Request; Bad Request com.amazonaws.services.s3.model.AmazonS3Exception: Bad Request (Service: Amazon S3; Status Code:400; Error Code:400 Bad Request;&lt;/P&gt;&lt;P&gt;step 3.add hadoop.security.credential.provider.path property file into core-site.xml.for this use can add access.key and secret.key file on hdfs path(hadoop credential API to store AWS secrets.).&lt;/P&gt;&lt;P&gt;example:these commands run as &lt;/P&gt;&lt;P&gt;I:     hdfs 
hdfs dfs -chown s3_acces:hdfs /user/s3_access &lt;/P&gt;&lt;P&gt;II:    hadoop credential create fs.s3a.access.key -value  aws-IAM-user_accesskey -   /      provider jceks://hdfs@10.22.121.0:8020/user/s3_access/s3.jceks.&lt;/P&gt;&lt;P&gt;III:hadoop credential create fs.s3a.secret.key -value  aws-IAM-user_secretkey -provider jceks://hdfs@10.22.121.0:8020/user/s3_access/s3.jceks&lt;/P&gt;&lt;P&gt;IV. hadoop credential list -provider jceks://hdfs@10.22.121.0:8020/user/s3_access/s3.jceks&lt;/P&gt;&lt;P&gt;you will get output as below: &lt;/P&gt;&lt;P&gt;Listing aliases for CredentialProvider:&lt;/P&gt;&lt;P&gt; jceks://hdfs@13.229.32.224:8020/user/s3_access/s3.jceks &lt;/P&gt;&lt;P&gt;fs.s3a.secret.key&lt;/P&gt;&lt;P&gt; fs.s3a.access.key&lt;/P&gt;&lt;P&gt;finally you craeted store AWS secrets credential on hadoop]&lt;/P&gt;&lt;P&gt;hdfs dfs -chowm  s3_acces:hdfs /user/s3_access/s3.jceks &lt;/P&gt;&lt;P&gt;hdfs dfs -chmod 666 /user/s3_access/s3.jceks &lt;/P&gt;&lt;P&gt; &amp;lt;property&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;lt;name&amp;gt;hadoop.security.credential.provider.path&amp;lt;/name&amp;gt;   &amp;lt;value&amp;gt;jceks://hdfs@10.22.121.0:8020/user/s3_access/s3.jceks&amp;lt;/value&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;step 4:restart ambari-server: &lt;/P&gt;&lt;P&gt;ambari-server restart&lt;/P&gt;&lt;P&gt; 
hadoop fs -ls s3a://yourbucketname/folder/file.csv &lt;/P&gt;&lt;P&gt;hadoop distcp s3a://yourbucketname/foldername/filename.csv hdfs://10.22.121.0:8020/you hdfc folder&lt;/P&gt;&lt;P&gt;flollow this link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP2/HDP2.6.2/bk_cloud-data-access/content/s3-config-props.html" target="_blank"&gt;https://docs.hortonworks.com/HDPDocuments/HDP2/HDP2.6.2/bk_cloud-data-access/content/s3-config-props.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 12:54:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/access-amazon-S3-bucket-from-hdfs/m-p/132086#M34869</guid>
      <dc:creator>swami_sangamesh</dc:creator>
      <dc:date>2018-04-05T12:54:44Z</dc:date>
    </item>
  </channel>
</rss>

