【问题标题】:Amazon RedShift Copy CommandAmazon RedShift 复制命令
【发布时间】:2014-09-11 16:26:35
【问题描述】:

我正在使用在这个page 上找到的数据来练习复制命令。

但是我遇到了一个异常

org.postgresql.util.PSQLException: 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 8D10A2C0B9C7570E,ExtRid VTQZsFdP8DRiJPza+Ko4bc2Y91P9Wra0Qb9C
  Detail: 
  -----------------------------------------------
  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 8D10A2C0B9C7570E,ExtRid VTQZsFdP8DRiJPza+Ko4bc2Y91P9Wra0Qb9C
  code:      8001
  context:   Listing bucket=awssampledb prefix=tickit/allusers_pipe.txt
  query:     576
  location:  s3_utility.cpp:525
  process:   padbmaster [pid=4283]

我做错了什么?

【问题讨论】:

    标签: amazon-web-services amazon-s3 amazon-redshift


    【解决方案1】:

    S3 存储桶和 redshift 必须位于同一区域(美国东部):

    此示例使用位于美国东部(弗吉尼亚北部)区域的 Amazon S3 存储桶。当您使用 COPY 命令加载数据时,包含您的数据的存储桶必须与您的集群位于同一区域。

    如果您的 redshift 集群位于另一个区域,请查看 Step 5: Load Sample Data from Amazon S3,滚动到带有 region-specific-bucket-name 的表:

    ------------------------------+------------------ ------------+ |地区 |特定区域的存储桶名称 | ------------------------------+------------------ ------------+ |美国东部(弗吉尼亚北部) | awssampledb | ------------------------------+------------------ ------------+ |美国西部(俄勒冈)| awssampledbuswest2 | ------------------------------+------------------ ------------+ |欧盟(爱尔兰)| awssampledbeuwest1 | ------------------------------+------------------ ------------+ |亚太地区(新加坡)| awssampledbapsoutheast1 | ------------------------------+------------------ ------------+ |亚太地区(悉尼)| awssampledbapsoutheast2 | ------------------------------+------------------ ------------+ |亚太地区(东京) | awssampledbapnortheast1 | ------------------------------+------------------ ------------+

    【讨论】:

      【解决方案2】:

      s3 存储桶和 Redshift 应位于同一区域。如果没有,则需要在复制命令中指定 Region 选项,然后加载才能正常工作。

      【讨论】:

        【解决方案3】:

        指定源区域如下

        copy pep.test 
        (operation, task_id, task_name)
        from 's3://move-redshift-data-devo/move-redshift-data-devo/'
        iam_role 'arn:aws:iam::355750824903:role/RedshiftDynamoDBAccess'
        format as csv
        region as 'us-east-1';
        

        https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-source-s3.html#copy-region

        【讨论】:

        • 通用且可接受的解决方案,而不是限制在同一区域。
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-09-06
        • 1970-01-01
        • 2018-04-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多