【问题标题】:Copying data from S3 to Redshift将数据从 S3 复制到 Redshift
【发布时间】:2015-10-03 06:58:46
【问题描述】:

我觉得这应该比我做的要容易得多。

copy table
from 's3://s3-us-west-1.amazonaws.com/bucketname/filename.csv'
CREDENTIALS 'aws_access_key_id=my-access;aws_secret_access_key=my-secret'
REGION 'us-west-1';

注意,我在遇到问题后添加了 REGION 部分,但什么也没做。

我感到困惑的是,在存储桶属性中只有https://path/to/the/file.csv。我只能假设我读过的所有文档都要求路径以 s3://... 开头,我只需将 https 更改为 s3,如我的示例中所示。

但是我得到了这个错误:

"Error : ERROR:  S3ServiceException:
The bucket you are attempting to access must be addressed using the specified endpoint. 
Please send all future requests to this endpoint.,Status 301,Error PermanentRedirect,Rid"

我正在使用 PostgreSQL 的 navicat 连接到 Redshift 并在 mac 上运行。

【问题讨论】:

    标签: postgresql amazon-s3 amazon-redshift navicat


    【解决方案1】:

    S3 路径应为“s3://bucketname/filename.csv”。试试这个。

    【讨论】:

    • 是的,这正是需要使用的内容...我期望提供的不仅仅是存储桶名称。
    【解决方案2】:

    是的,应该会容易得多:-)

    当您的 S3 存储桶不是美国标准时,我才看到此错误。在这种情况下,您需要使用基于端点的地址,例如http://s3-eu-west-1.amazonaws.com/mybucket/myfile.txt.

    您可以在此文档页面中找到您所在地区的端点, http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

    【讨论】:

    • 感谢您的回答。
    猜你喜欢
    • 2018-09-12
    • 1970-01-01
    • 2019-04-23
    • 2013-05-31
    • 1970-01-01
    • 2018-01-26
    • 2022-01-26
    • 1970-01-01
    • 2016-09-25
    相关资源
    最近更新 更多