Unable to create snapshot repository

As im in process of backup of cluster, so i tried to create repository under specific location by adding the below line in elasticsearch.yml

path.repo: ["/mount/backups"]

After adding the line, i have restarted the node by below steps.

[Rolling Restarts | Elasticsearch: The Definitive Guide [2.x] | Elastic](http://Rolling Restart)

After restart, i have executed the below query in cerebro but i'm facing error like am unable to create repository location.

PUT /_snapshot/my_fs_backup
{
"type": "fs",
"settings": {
"location": "/mount/backups/my_fs_backup_location",
"compress": true
}
}

Error Msg :-

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

Kindly help me to resolve this issue, as im unable to create repository.

Thanks in advance...

Hi @Joseph_Raj

It looks like the problem is that you are using an absolute path that is a sub-path of your path.repo setting. Try setting the relative path

"location":  "my_fs_backup_location"

instead. That should work fine. Also, did you set the setting on all your nodes? It seems from the error message that one of them is missing the setting.

I have tried both the absolute path and relative path but the error still same.

Actually, we have 2 master nodes and 6 elastic search nodes. So as initial step, we are trying in only one node for snapshot.
So we have placed the setting at only one node and trying to create the repository on the same.
Kindly let us know that our approach is right or wrong ?
Is it required to set the settings in all master & other nodes also ?

Thanks in advance !!!

Hi @Joseph_Raj

From Snapshot And Restore - Shared File System Repository:

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.

As the backup location is registered for the cluster, every node needs access to the exact same path. Not every node in the cluster may own shards from every index, thus you can't register the repository for only one node.

1 Like

We have currently modified only one node for testing purpose. But we have 2 master & 6 other nodes.

Do we need to change the settings in all the 6 + 2 nodes of .yml files for the snapshot and repository creation?

Thanks in advance ...

Yes, snapshots are cluster wide so have to be set up on ALL nodes.

1 Like

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