Path.repo is set but cannot create snapshot


(Christopher Cheng) #1

I have set path.repo in elasticsearch.yml and I can see that in

http://127.0.0.1:9200/_nodes/?pretty

"path" : {
"data" : "/var/lib/elasticsearch",
"home" : "/usr/share/elasticsearch",
"conf" : "/etc/elasticsearch",
"logs" : "/var/log/elasticsearch",
"repo" : [ "/backups/elasticsearch" ]
},

It is the only node in the cluster and I have restarted elasticsearch after the config is modified.
The repo directory is a NFS directory and the mode is 777,
When I issue the command to create a snapshot, it returns that path.repo is missing...

curl -XPUT 'http://127.0.0.1:9200/_snapshot/my_backup' -d '
{
"type": "fs",
"settings": {
"compress": true,
"location": "/backups/elasticsearch"
}
}
'

{"error":{"root_cause":[{"type":"repository_exception","reason":"[my_backup] location [/backups/elasticsearch] 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":"creation_exception","reason":"creation_exception: Guice creation errors:\n\n1) Error injecting constructor, RepositoryException[[my_backup] location [/backups/elasticsearch] doesn't match any of the locations specified by path.repo because this setting is empty]\n at org.elasticsearch.repositories.fs.FsRepository.(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 [/backups/elasticsearch] doesn't match any of the locations specified by path.repo because this setting is empty"}}},"status":500}


(Mark Walkom) #2

Set how?


(Christopher Cheng) #3

I have tried both of them

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

path.repo: /backups/elasticsearch


(Christopher Cheng) #4

Forgot to mention, the version is
elasticsearch-2.4.1-1.noarch


(Christopher Cheng) #5

It turned out that there are 2 instance of elasticsearch running on the same machine because of unclean shutdown.
I use kill -9 to kill of them and restarted, then it is fine


(system) #6