Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify AWS Access Key ID and Secret Access Key as part of a amazon s3n URL

Tags:

I am passing input and output folders as parameters to mapreduce word count program from webpage.

Getting below error:

HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: AWS Access Key ID and Secret Access Key must be specified as the username or password (respectively) of a s3n URL, or by setting the fs.s3n.awsAccessKeyId or fs.s3n.awsSecretAccessKey properties (respectively).

like image 762
user3795951 Avatar asked Jul 24 '14 03:07

user3795951


People also ask

How do I encrypt AWS access key and secret key?

Any encryption of the access keys and/or secret keys must be done by the software using them. However, a recommended alternative to using access keys and secrets is to use IAM roles. If your Travis CI is hosted by a third-party, then you should use IAM Third-party roles with that third-party instead of access keys.

What is the difference between AWS access key and secret key?

Access Keys are used to sign the requests you send to Amazon S3. Like the Username/Password pair you use to access your AWS Management Console, Access Key Id and Secret Access Key are used for programmatic (API) access to AWS services. You can manage your Access Keys in AWS Management Console.

Which entity is associated with an access key ID and Secret access key?

An IAM user is an entity that represents a person or service. Can be assigned: An access key ID and secret access key for programmatic access to the AWS API, CLI, SDK, and other development tools.


2 Answers

The documentation has the format: http://wiki.apache.org/hadoop/AmazonS3

 s3n://ID:SECRET@BUCKET/Path 
like image 93
RickH Avatar answered Sep 19 '22 15:09

RickH


I suggest you use this:

hadoop distcp \ -Dfs.s3n.awsAccessKeyId=<your_access_id> \  -Dfs.s3n.awsSecretAccessKey=<your_access_key> \ s3n://origin hdfs://destinations 

It also works as a workaround for the occurrence of slashes in the key. The parameters with the id and access key must be supplied exactly in this order: after disctcp and before origin

like image 25
Ricardo Teixeira Avatar answered Sep 22 '22 15:09

Ricardo Teixeira