使用ElasticSearch的“repository-s3”插件时出错

时间:2018-01-15 09:36:58

标签: elasticsearch amazon-s3 elasticsearch-plugin

我正在尝试将elasticsearch节点的快照存储库配置设置为S3。

我为elasticsearch安装了“repository-s3”插件。

PUT http://<username>:<password>@<elasticsearch-instance-ip>:9200/_snapshot/s3_repository?verify=false

    {
      "type": "s3",
      "settings": {
        "bucket": "bucket-name",
        "region": "eu-west-1",
        "access_key": "****",
        "secret_key": "****"
    }
}

,回复是:

{
    "error": {
        "root_cause": [
            {
                "type": "repository_exception",
                "reason": "[s3_repository] failed to create repository"
            }
        ],
        "type": "repository_exception",
        "reason": "[s3_repository] failed to create repository",
        "caused_by": {
            "type": "illegal_argument_exception",
            "reason": "Setting [access_key] is insecure, but property [allow_insecure_settings] is not set"
        }
    },
    "status": 500
}

我尝试在elasticsearch.yml配置文件中应用allow_insecure_settings设置,但这不起作用。

仅供参考我正在使用X-Pack插件

有什么建议吗?

2 个答案:

答案 0 :(得分:6)

vim config/jvm.options 

添加以下行: -Des.allow_insecure_settings=true 它对我有用。有一个未记录的系统属性: https://github.com/elastic/elasticsearch/issues/26589

答案 1 :(得分:1)

就我而言,设置bin/elasticsearch-keystore add s3.client.default.access_key.secret_key可以解决此问题。