We are new to the snapshot-and-restore function of Elasticsearch. Following the example below, we are trying to create a snapshot repository with the Console of Dev Tools.
The Elasticsearch server under test runs as a Docker container, and services runs with username elasticsearch
. So, we created a folder in the user's home directory, /usr/share/elasticsearch/my_backup_location
in the container.
PUT /_snapshot/my_backup
{
"type": "fs",
"settings": {
"location": "/usr/share/elasticsearch/my_backup_location"
}
}
However, the command did not work, and it got a "500-Internal Server Error" with the following error message:
{
"error": {
"root_cause": [
{
"type": "repository_exception",
"reason": "[my_backup] location [/usr/share/elasticsearch/my_backup_location] doesn't match any of the locations specified by path.repo because this setting is empty"
}
],
"type": "repository_exception",
"reason": "[my_backup] failed to create repository",
"caused_by": {
"type": "repository_exception",
"reason": "[my_backup] location [/usr/share/elasticsearch/my_backup_location] doesn't match any of the locations specified by path.repo because this setting is empty"
}
},
"status": 500
}
We wonder if we are missing anything in the test above and will highly appreciate any hints and suggestions.
Please let us know if you need more information.