1

I'm using elk-docker and trying to follow Snapshot And Restore | Elasticsearch Reference [2.4] | Elastic and getting following error:

# curl --request PUT --data '{ "type": "fs", "settings": {"compress": true, "location": "/run/elasticsearch/backups" } }' localhost:9200/_snapshot/my_backup?pretty
{
  "error" : {
    "root_cause" : [ {
      "type" : "repository_exception",
      "reason" : "[my_backup] failed to create repository"
    } ],
    "type" : "repository_exception",
    "reason" : "[my_backup] failed to create repository",
    "caused_by" : {
      "type" : "creation_exception",
      "reason" : "Guice creation errors:\n\n1) Error injecting constructor, RepositoryException[[my_backup] location [/run/elasticsearch/backups] doesn't match any of the locations specified by path.repo because this setting is empty]\n  at org.elasticsearch.repositories.fs.FsRepository.<init>(Unknown Source)\n  while locating org.elasticsearch.repositories.fs.FsRepository\n  while locating org.elasticsearch.repositories.Repository\n\n1 error",
      "caused_by" : {
        "type" : "repository_exception",
        "reason" : "[my_backup] location [/run/elasticsearch/backups] doesn't match any of the locations specified by path.repo because this setting is empty"
      }
    }
  },
  "status" : 500
}
# 

Please advice.

alexus
  • 12,342
  • 27
  • 115
  • 173

1 Answers1

0

I added path.repo into elasticsearch.yml:

# grep path.repo elasticsearch.yml 
path.repo: /run/elasticsearch/backups
# 

followed by docker-compose build & docker-compose up, and curl again:

# curl --request PUT --data '{ "type": "fs", "settings": {"compress": true, "location": "/run/elasticsearch/backups" } }' localhost:9200/_snapshot/my_backup?pretty
{
  "acknowledged" : true
}
#
alexus
  • 12,342
  • 27
  • 115
  • 173