AmazonS3Exception 与 Elasticsearch

AmazonS3Exception with Elasticsearch

我试图直接在 S3 存储桶上创建快照,但它抛出 AmazonS3Exception:

{"error":"SnapshotCreationException[[mysnapshotname:20161007-152322] failed to create snapshot]; nested: IOException[Unable to upload object preprodelasticsearch/snapshot-20161007-152322 due to AmazonS3Exception: AWS authentication requires a valid Date or x-amz-date header (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 5B10DA56C7832AD2)]; ","status":500}

清除错误:

AmazonS3Exception: AWS authentication requires a valid Date or x-amz-date header

我看到很多 topics 表示我需要升级我的 Java 和 AWS,这里是我的版本:

$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

$ aws --version
aws-cli/1.10.24 Python/2.7.6 Linux/3.13.0-48-generic botocore/1.4.15

问题应该在AWS 1.10.1版本上解决了,但在1.10.24中仍然得到它

我使用的https://github.com/elastic/elasticsearch-cloud-aws版本是2.7.0,也就是使用JavaSDK 1.9.34.

只需要迁移到使用 Java SDK 1.10.12 的 elasticsearch-cloud-aws 2.7.1,足以解决问题