The idea here is to take snapshots of all the indices at any given point of time. We have a python program which triggers the snapshot creation on the elasticsearch nodes. To keep all this simple, I am just trying in the repl shell to create a repository and it fails with the error saying a reference to empty path repo in the config/elasticsearch.yml. In reality this is not true and we have a configuration of path.repo in the configuration yml.
path.repo: ["/usr/share/elasticsearch/data/backups"]
I also tried setting the path repo as single entry rather than the list of a single element.
path.repo: "/usr/share/elasticsearch/data/backups"
This path repo is also effective. I have verified by doing a GET/_nodes/settings.
"name": "es-cluster-name"
},
"node": {
"name": "es-cluster-name_elasticsearch_2",
"path": {
"repo": [
"/usr/share/elasticsearch/data/backups"
]
}
},
"path": {
"logs": "/usr/share/elasticsearch/logs",
"home": "/usr/share/elasticsearch"
This is present for every node. The filesystem also has the directory present at /usr/share/elasticsearch/data/backups.
When I try to create the the repository this is what i get.
>>> data = {
... "type": "fs",
... "settings": {
... "compress": "true",
... "location": "/usr/share/elasticsearch/data/backups",
... }
... }
>>> es.snapshot.create_repository('test', body=data)
PUT http://lb-elasticsearch:9200/_snapshot/test [status:500 request:1.255s]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
elasticsearch.exceptions.TransportError: TransportError(500, 'repository_exception', "[test] location [/usr/share/elasticsearch/data/backups] doesn't match any of the locations specified by path.repo because this setting is empty")
Here I trimmed the unnecessary trace. Following are the logs from console.
0:20:411) Error injecting constructor, RepositoryException[[test] location [/usr/share/elasticsearch/data/backups] doesn't match any of the locations specified by path.repo because this setting is empty]
10/01/2017 00:20:41 at org.elasticsearch.repositories.fs.FsRepository.<init>(Unknown Source)
10/01/2017 00:20:41 while locating org.elasticsearch.repositories.fs.FsRepository
10/01/2017 00:20:41 while locating org.elasticsearch.repositories.Repository
10/01/2017 00:20:41
10/01/2017 00:20:411 error]; nested: RepositoryException[[test] location [/usr/share/elasticsearch/data/backups] doesn't match any of the locations specified by path.repo because this setting is empty];
10/01/2017 00:20:41 at org.elasticsearch.common.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:360)
10/01/2017 00:20:41 at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:178)
10/01/2017 00:20:41 at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110)
10/01/2017 00:20:41 at org.elasticsearch.common.inject.InjectorImpl.createChildInjector(InjectorImpl.java:154)
10/01/2017 00:20:41 at org.elasticsearch.common.inject.ModulesBuilder.createChildInjector(ModulesBuilder.java:55)
10/01/2017 00:20:41 at org.elasticsearch.repositories.RepositoriesService.createRepositoryHolder(RepositoriesService.java:404)
10/01/2017 00:20:41 ... 11 more
With all this. I am unable to find the route of troubleshooting this scenario.
Thanks in advance. All this setup is in docker inside rancher.