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?
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
In my case, setting of bin/elasticsearch-keystore add s3.client.default.access_key and .secret_key fixed this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With