Error when Registering new Snapshot Repository

Hi, I am trying to snapshot an elasticsearch repository.

I have three different nodes across three different servers, e.g. 10.212.145.10, 10.212.145.20, 10.212.145.30.

I have added the path.repo field in my elasticsearch.yml file (etc/elasticsearch/elasticsearch.yml) on 10.212.145.10 as such:

path.repo: ["/mnt/elasticsearch_repository/backup"]

Note, I have also tried without the square brackets to no avail.

I then do an service elasticsearch restart which works fine.

Then, when I run the following curl command to registry the repository:

curl -XPUT -H "Content-Type: application/json" 'http://10.212.145.10:9200/_snapshot/backup' -d '{
    "type": "fs",
    "settings": {
        "location": "/mnt/elasticsearch_repository/backup",
        "compress": true
    }
}'

I get the following error:

{"error":{"root_cause":[{"type":"repository_exception","reason":"[backup] location [/mnt/elasticsearch_repository/backup] doesn't match any of the locations specified by path.repo because this setting is empty"}],"type":"repository_exception","reason":"[backup] failed to create repository","caused_by":{"type":"repository_exception","reason":"[backup] location [/mnt/elasticsearch_repository/backup] doesn't match any of the locations specified by path.repo because this setting is empty"}},"status":500} 

I am using centos. Does anyone have any ideas.

I have also already looked on this thread and it doesn't solve my problem: Path.repo is empty

Welcome!

You need to add this setting on every node.

1 Like

would I have to add the IP of the first node?

So, for my 10.212.145.20 node, would I set path.repo as:

path.repo: ["/mnt/elasticsearch_repository/backup"]

or

path.repo: 10.212.145.10:["/mnt/elasticsearch_repository/backup"]

The dir needs to be mounted the same way on every machine and you should have on all machines the same setting:

path.repo: ["/mnt/elasticsearch_repository/backup"]

Great thank you so much - they do all have the same config so that makes sense.

So, my repository is registered now. However, I don't know how to make the repo interact with the other nodes. Do I need to mount the repository to the other nodes or is that what path.repo does?

My nodes 2 and 3 are giving the following errors:

Active: failed (Result: exit-code) since Wed 2020-04-01 10:42:08 BST; 23s ago
Docs: http://www.elastic.co
Process: 25916 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 25916 (code=exited, status=1/FAILURE)

Apr 01 10:42:05 ES02 systemd[1]: Started Elasticsearch.
Apr 01 10:42:08 ES02 systemd[1]: elasticsearch.service: main process exited...RE
Apr 01 10:42:08 ES02 systemd[1]: Unit elasticsearch.service entered failed ...e.
Apr 01 10:42:08 ES02 systemd[1]: elasticsearch.service failed

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.