【问题标题】:S3 throws 500 when trying to restore snapshot to AWS ES 6.2 [cross-region]S3 在尝试将快照还原到 AWS ES 6.2 [跨区域] 时抛出 500
【发布时间】:2021-03-05 20:38:01
【问题描述】:

尝试将 v5.3 ES 快照从 S3 恢复到 ES 6.2。快照存储桶位于 us-east-1 中,我正在尝试将其还原到 us-west-2 中的 Amazon ES 集群。是跨账号、跨地域的恢复操作。

在us-west-2 ES集群中注册的快照仓库如下

{
    "type": "s3",
        "settings": {
            "bucket": "valid-bucket-name",
            "server_side_encryption": "true",
            "endpoint": "s3.amazonaws.com",
            "region" : "us-east-1",
            "role_arn": "valid-role"
        }
}

得到响应

{
    "acknowledged": true
}

但是,当我尝试恢复特定快照时,S3 会抛出 301

{
    "error": {
        "root_cause": [
            {
                "type": "amazon_s3_exception",
                "reason": "amazon_s3_exception: The bucket is in this region: us-east-1. Please use this region to retry the request (Service: Amazon S3; Status Code: 301; Error Code: PermanentRedirect; Request ID: D72EFE8A89F76F57; S3 Extended Request ID: in03KW452re297MDp3GQQRFjJhMRXeP4md+FU99CHZ7D4TQKz8PBuSZKoO3+IFd+wAxNApztG5Y=)"
            }
        ],
        "type": "amazon_s3_exception",
        "reason": "amazon_s3_exception: The bucket is in this region: us-east-1. Please use this region to retry the request (Service: Amazon S3; Status Code: 301; Error Code: PermanentRedirect; Request ID: D72EFE8A89F76F57; S3 Extended Request ID: in03KW452re297MDp3GQQRFjJhMRXeP4md+FU99CHZ7D4TQKz8PBuSZKoO3+IFd+wAxNApztG5Y=)"
    },
    "status": 500
}

存储库已配置区域 us-east-1。错误信息没有用。

如果我只是按照@Michael-sqlbot 的建议指定端点,那么它将抛出以下错误

{
    "error": {
        "root_cause": [
            {
                "type": "amazon_s3_exception",
                "reason": "amazon_s3_exception: The bucket is in this region: us-east-1. Please use this region to retry the request (Service: Amazon S3; Status Code: 301; Error Code: 301 Moved Permanently; Request ID: CC1853D0EF68B5F7; S3 Extended Request ID: nrbWmI3OiPLdrMcRT6FiOHJineYv6clmSf+GcXtBBwKSzfIEV2gmMZjWEDtyCIRQUg+dM/Vmawg=)"
            }
        ],
        "type": "blob_store_exception",
        "reason": "Failed to check if blob [master.dat-temp] exists",
        "caused_by": {
            "type": "amazon_s3_exception",
            "reason": "amazon_s3_exception: The bucket is in this region: us-east-1. Please use this region to retry the request (Service: Amazon S3; Status Code: 301; Error Code: 301 Moved Permanently; Request ID: CC1853D0EF68B5F7; S3 Extended Request ID: nrbWmI3OiPLdrMcRT6FiOHJineYv6clmSf+GcXtBBwKSzfIEV2gmMZjWEDtyCIRQUg+dM/Vmawg=)"
        }
    },
    "status": 500
}

更新:我可以确认这是 s3-snapshot-plugin 的区域/端点相关问题。在 us-east-1(与存储桶的区域相同的区域)中创建了另一个集群,并且没有任何问题。

【问题讨论】:

    标签: elasticsearch amazon-s3


    【解决方案1】:

    这似乎可能相关:

    重要

    如果 S3 存储桶位于 us-east-1 区域,则需要使用 "endpoint": "s3.amazonaws.com" 而不是 "region": "us-east- 1"。 (强调)

    https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains-snapshots.html

    【讨论】:

    【解决方案2】:

    由于缺乏声誉,无法评论迈克尔的回答:-)

    我尝试了他们建议的解决方法,在 us-west-2 中的新 7.9 集群上设置快照存储库,存储桶位于 eu-west-2 中,并且成功了!尽管在亚马逊的开发人员指南中似乎不再记录。我会向他们提交反馈。

    顺便说一句,如果您尝试从另一个集群迁移数据,请不要忘记将"readonly": true 添加到settings 对象。这只是为了防止意外写入该 repo。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-04
      • 2019-01-06
      • 1970-01-01
      • 2015-01-29
      • 2017-09-03
      • 2016-12-18
      相关资源
      最近更新 更多