【问题标题】:S3 as Target Dir in Sqoop ImportS3 作为 Sqoop 导入中的目标目录
【发布时间】: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

标签: amazon-s3 sqoop


【解决方案1】:

您是否尝试过以下链接?根据博客,它应该是 s3a。

https://www.cloudera.com/documentation/enterprise/latest/topics/admin_sqoop_s3_import.html

sqoop -Dfs.s3a.access.key=xxxxx -Dfs.s3a.secret.key=xxxxx -Dfs.s3a.endpoint="s3.amazonaws.com" \
import --connect jdbc:mysql://hostname/mytable --username myuser --password mypassword --table mytable \
--target-dir s3a://mybucket/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-13
    • 2020-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多