Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid hostname error when connecting to s3 sink when using secret key having forward slash

I have a forward slash in aws secret key.

When I try to connect to s3 sink

Caused by: java.lang.IllegalArgumentException: Invalid hostname in URI s3://xxxx:xxxx@jelogs/je.1359961366545
    at org.apache.hadoop.fs.s3.S3Credentials.initialize(S3Credentials.java:41)

When I encode forward slash with %2F, I get

The request signature we calculated does not match the signature you provided. Check your key and signing method.

How should I encode my secret key.

like image 641
robert Avatar asked Jan 15 '23 07:01

robert


1 Answers

samthebest solution works, you just have to add "" surrounding the keys. Here how to use it:

hadoop distcp -Dfs.s3a.awsAccessKeyId="yourkey" -Dfs.s3a.awsSecretAccessKey="yoursecret" <your_hdfs_path> s3a://<your-bucket>
like image 56
Santiago Trias Avatar answered Jan 22 '23 17:01

Santiago Trias