使用s3在GCS上创建快照时出现Elasticsearch SignatureDoesNotMatch错误

时间:2016-10-14 15:26:33

标签: elasticsearch amazon-s3 google-cloud-storage elasticsearch-plugin

我使用已安装的cloud-aws插件运行elasticsearch 2.3.0。 我尝试使用cloud-aws插件在Google云端存储上创建快照,因为他知道Google存储与S3兼容。

我遵循了这个文档 https://cloud.google.com/storage/docs/migrating#keys

对于所谓的"迁移"一部分。

很遗憾,我收到此错误: curl -XPUT http://XXX:9200/_snapshot/google-test-repo -d '{ "type": "s3", "settings": { "endpoint": "storage.googleapis.com", "bucket": "/my-bucket", "base_path": "mydirectory", "access_key": "my-google-dev-key", "secret_key": "my-google-secret-key" } }'

其余的电话我发送:

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

广告这是回复:

{{1}}

有人可以帮我吗?

1 个答案:

答案 0 :(得分:0)

通过提供适当的签名者类型

解决了我的问题

快照创建尝试执行PUT请求,因此失败并出现上述错误。在elasticsearch.yml配置文件中添加以下给定行后,错误应该消失。请注意,您需要在yml文件中进行任何更改后重新启动elasticsearch服务。

cloud.aws.s3.signer: S3SignerType

参考:https://github.com/elastic/elasticsearch-cloud-aws/issues/223