我在aws密钥中有 forward slash
。
当我尝试连接到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)
当我使用%2F
对正斜杠进行编码时,我得到了
The request signature we calculated does not match the signature you provided. Check your key and signing method.
我应该如何编码我的密钥。
答案 0 :(得分:4)
samthebest解决方案有效,您只需要添加""围绕钥匙。在这里如何使用它:
hadoop distcp -Dfs.s3a.awsAccessKeyId="yourkey" -Dfs.s3a.awsSecretAccessKey="yoursecret" <your_hdfs_path> s3a://<your-bucket>
答案 1 :(得分:3)
我最终创建了一个没有正斜杠的新密钥。这是一个已知问题,生成新密钥只是解决方案。
答案 2 :(得分:2)
使用
-Dfs.s3n.awsAccessKeyId=<your-key> -Dfs.s3n.awsSecretAccessKey=<your-secret-key>
e.g。
hadoop distcp -Dfs.s3n.awsAccessKeyId=<your-key> -Dfs.s3n.awsSecretAccessKey=<your-secret-key> -<subsubcommand> <args>
或
hadoop fs -Dfs.s3n.awsAccessKeyId=<your-key> -Dfs.s3n.awsSecretAccessKey=<your-secret-key> -<subsubcommand> <args>