簡體   English   中英

Amazon RedShift 復制命令

[英]Amazon RedShift Copy Command

我正在使用在此頁面上找到的數據來練習復制命令。

但我遇到了一個例外

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]

我究竟做錯了什么?

S3 存儲桶和 redshift 必須位於同一區域(美國東部):

此示例使用位於美國東部(弗吉尼亞北部)區域的 Amazon S3 存儲桶。 當您使用 COPY 命令加載數據時,包含您數據的存儲桶必須與您的集群位於同一區域。

如果您的 redshift 集群位於另一個區域,請查看步驟 5:從 Amazon S3 加載示例數據,滾動到帶有region-specific-bucket-name 的表

------------------------------+-------------------------------+
| Region                      |  region-specific-bucket-name  |
------------------------------+-------------------------------+
| US East (Northern Virginia) |  awssampledb                  |
------------------------------+-------------------------------+
| US West (Oregon)            |  awssampledbuswest2           |
------------------------------+-------------------------------+
| EU (Ireland)                |  awssampledbeuwest1           |
------------------------------+-------------------------------+
| Asia Pacific (Singapore)    |  awssampledbapsoutheast1      |
------------------------------+-------------------------------+
| Asia Pacific (Sydney)       |  awssampledbapsoutheast2      |
------------------------------+-------------------------------+
| Asia Pacific (Tokyo)        |  awssampledbapnortheast1      |
------------------------------+-------------------------------+

指定源區域如下

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

它可能是 ACL 設置。 如果對象由另一個帳戶創建

s3 存儲桶和 Redshift 應位於同一區域。 如果沒有,則需要在復制命令中指定 Region 選項,然后加載才能正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM