alex.bour
alex.bour

Reputation: 2976

Can't create repo for ElasticSearch snapshot

I'm trying to create a backup repo for my ElasticSearch snapshot.

curl -XPUT 'http://localhost:9200/_snapshot/backup' -d '{
  "type": "fs",
  "settings": {
    "location": "/home/admin/dumps/elasticsearch",
    "compress": true
  }
}'

The issue I obtained is:

{"error":{"root_cause":[{"type":"repository_exception","reason":"[backup] failed to create repository"}],...

I'm quite sure it's a right/user problem on my directory.

I tried:

chmod 777 /home/admin/dumps/elasticsearch

Actually the repo rights are:

drwxrwxrwx  2 admin admin 4096 Jan  6 14:39 elasticsearch

But I have the same issue.

I also tried the curl using sudo (same issue).

Well, I'm lost now. ;-) Thanks in advance.

Upvotes: 1

Views: 5883

Answers (1)

ChintanShah25
ChintanShah25

Reputation: 12672

You first have to mount your shared filesystem to the same location on all the nodes, so add path.repo: ["/home/admin/dumps/elasticsearch"] to elasticsearch.yml

From the Docs

In order to register the shared file system repository it is necessary to mount the same shared filesystem to the same location on all master and data nodes. This location (or one of its parent directories) has to be registered in the path.repo setting on all master and data nodes.

Then You need to restart all your nodes.

Upvotes: 7

Related Questions