MAC Elasticsearch快照位置

时间:2015-09-28 14:09:03

标签: elasticsearch

在MAC elasticsearch中构建存储库

PUT http://localhost:9400/_snapshot/my_backup 
{
    "type": "fs", 
    "settings": {
        "location": "/Users/Edison/Elasticsearch/Repository" 
    }
}

我的电脑是MacOS

我不明白,如何设置我的位置路径..

这是我的错误消息:

{
   "error": "RepositoryException[[my_backup] failed to create repository]; nested: CreationException[Guice creation errors:\n\n1) Error injecting constructor, org.elasticsearch.repositories.RepositoryException: [my_backup] location [/Users/Edison/Elasticsearch/Repository] 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]; nested: RepositoryException[[my_backup] location [/Users/Edison/Elasticsearch/Repository] doesn't match any of the locations specified by path.repo because this setting is empty]; ",
   "status": 500
}

2 个答案:

答案 0 :(得分:1)

Elasticsearch节点需要为每个节点保存一个共享驱动器,此共享目录是location属性所指的位置。

第一项任务是设置此共享存储,例如,您可以选择直接的NFS挂载:https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-12-04在每个节点上安装目录后,您就可以注册备份位置。

或者您可以使用Samba共享,这似乎是以下内容的指南:http://vichargrave.com/creating-elasticsearch-snapshots/

答案 1 :(得分:1)

我遇到的错误,

&#34; repository_exception&#34;,&#34; reason&#34;:&#34; [my_backup] location [/ tmp / my_backup]与指定的任何位置都不匹配path.repo,因为此设置为空&#34;}}}

操作系统Centos

[ec2-user@ip-10-33-207-201 config]$ curl -XPUT 'http://localhost:9200/_snapshot/my_backup' -d '{
> "type": "fs",
> "settings": {
> "location": "/tmp/my_backup",
> "compress": true
> }
> }'
{"acknowledged":true}[ec2-user@ip-10-33-207-201 config]$

<强>解决方案

您需要将存储库路径添加到elasticsearch.yml文件

path.repo: ["/tmp/my_backup"]

<强>参考 https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html