![elastic 的快照和恢复模块repository_exception](https://linux22.com/image/690601/elastic%20%E7%9A%84%E5%BF%AB%E7%85%A7%E5%92%8C%E6%81%A2%E5%A4%8D%E6%A8%A1%E5%9D%97repository_exception.png)
我在用着elk-docker并试图跟随快照与恢复 | Elasticsearch 参考 [2.4] | Elastic并出现以下错误:
# 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
}
#
请指教。
答案1
我补充path.repo
说elasticsearch.yml
:
# grep path.repo elasticsearch.yml
path.repo: /run/elasticsearch/backups
#
然后是docker-compose build
& docker-compose up
,然后curl
再次:
# curl --request PUT --data '{ "type": "fs", "settings": {"compress": true, "location": "/run/elasticsearch/backups" } }' localhost:9200/_snapshot/my_backup?pretty
{
"acknowledged" : true
}
#