尝试将快照还原到AWS ES 6.2时,S3会抛出500 [跨区域]

时间:2018-05-18 00:20:14

标签: elasticsearch amazon-s3

尝试将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(与bucket的区域相同的区域)中创建了另一个集群,它可以解决任何问题。

2 个答案:

答案 0 :(得分:0)

这似乎有可能相关:

  

重要

     

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

     

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

答案 1 :(得分:0)

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

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

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