Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error using "repository-s3" plugin for ElasticSearch

I'm trying to set the configuration for snapshot repository of elasticsearch nodes to S3.

I have installed the "repository-s3" plugin for elasticsearch.

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": "****"
    }
}

and the response is:

{
    "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
}

I have tried applying allow_insecure_settings setting in the elasticsearch.yml configuration file but that does not work.

FYI I'm using X-Pack plugin

Any suggestions?

like image 409
zubair1024 Avatar asked Jan 15 '18 09:01

zubair1024


2 Answers

vim config/jvm.options 

Add the below line: -Des.allow_insecure_settings=true It is working for me. there is an undocumented system property: https://github.com/elastic/elasticsearch/issues/26589

like image 82
Han Avatar answered Oct 02 '22 14:10

Han


In my case, setting of bin/elasticsearch-keystore add s3.client.default.access_key and .secret_key fixed this issue.

like image 26
Saurav Sahu Avatar answered Oct 02 '22 14:10

Saurav Sahu