使用cloud-aws插件和s3区域恢复弹性搜索快照不起作用

时间:2016-05-19 13:52:29

标签: elasticsearch amazon-s3 elasticsearch-plugin

我正在尝试使用elasticsearch cloud-aws插件从s3恢复快照。 elasticsearch和cloud-aws插件都是2.2.0版本。

奇怪的是,在我的本地计算机上,如果我指定区域,我只能恢复快照,如下所示:

{
  "type": "s3",
  "settings": {
    "bucket": "bucketname",
    "region": "us-west-1",
    "access_key": "XXXX",
    "secret_key": "XXXX",
    "base_path": "path/to/snapshot",
    "compress": "true"
  }
}

如果我遗漏该区域,快照恢复将失败,并显示以下错误(名称已更改):

{
  "error": {
    "root_cause": [
      {
        "type": "repository_verification_exception",
        "reason": "[repositoryname] path [path][to][snapshot] is not accessible on master node"
      }
    ],
    "type": "repository_verification_exception",
    "reason": "[repositoryname] path [path][to][snapshot] is not accessible on master node",
    "caused_by": {
      "type": "i_o_exception",
      "reason": "Unable to upload object path/to/snapshot/tests-pJjA4cwNREu8RsFsXTn4Qg/master.dat-temp",
      "caused_by": {
        "type": "amazon_s3_exception",
        "reason": "The request signature we calculated does not match the signature you provided. Check your key and signing method. (Service: Amazon S3; Status Code: 403; Error Code: SignatureDoesNotMatch; Request ID: 7D8675025D7DB3ED)"
      }
    }
  },
  "status": 500
}

但是,在我的服务器上,只有当我指定区域时,快照恢复才会成功,如下所示:

{
  "type": "s3",
  "settings": {
    "bucket": "bucketname",
    "access_key": "XXXX",
    "secret_key": "XXXX",
    "base_path": "path/to/snapshot",
    "compress": "true"
  }
}

如果我执行指定区域,无论我选择哪个区域,快照恢复都将失败,并显示与上面相同的错误。

由于我正在自动执行快照还原,因此我希望所有服务器和localhost都可以预测该行为。我究竟做错了什么?还是错过了?

非常感谢任何帮助,谢谢!

1 个答案:

答案 0 :(得分:0)

我自己找到了原因:我更新了我的Java JRE / JDK,以及JAVA_HOME环境变量和Elasticsearch windows服务,但由于某种原因,我仍然需要重新启动Windows才能获得cloud-aws插件再次运行。