【发布时间】:2017-11-30 21:47:12
【问题描述】:
尝试使用 sqoop 导入命令导入数据库表,目标目录指定为 Amazon S3 存储桶名称。 命令如下
sqoop import --connect jdbc:mysql://hostname/mytable --username myuser --password mypassword --table mytable --target-dir s3://<secret_code>:<secret_key>@s3-us-west-2.amazonaws.com/mybucket/
它一直给我拒绝访问 S3Exception。密钥/代码凭据有效,并且为每个人设置了存储桶权限。
感谢您的帮助。
【问题讨论】:
-
您好,您能否使用控制台中的 hadoop 命令访问目标目录:hadoop fs -ls s3://
: @s3-us-west-2.amazonaws .com/mybucket/ -
不。同样的错误。它可以与密钥中的特殊字符有关吗?谢谢。
-
看起来您无权访问目标目录。请检查网址是否正确。
-
我用 distcp 尝试了相同的凭据并且效果很好。猜想,我将不得不分两步完成。首先,使用 sqoop 导入 hdfs,然后使用 distcp 从 hdfs 复制到 s3