我正在使用 Elasticsearch 1.4 和 ubuntu 12.04.3 LTS。尝试为本地 elasticsearch 创建快照。我参考这个website http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-snapshots.html
该网站步骤在 Windows Elasticsearch 上运行良好。如果我在 Ubuntu Elasticsearch 上注册存储库。它触发了下面的消息。
这个查询我运行什么
curl -XPUT http://xx.xx.xx.xx:9200/_snapshot/es_snap -d '{
"type": "fs",
"settings": {
"location": "/mount/backups/my_backup"
}
}'
我收到了这个回复。
{
"error":"RepositoryException[[es_snap] failed to create repository];
nested: CreationException[Guice creation errors:\n\n1) Error injecting constructor, org.elasticsearch.common.blobstore.BlobStoreException:
Failed to create directory at [
D:/data/es_snapshot_bkup/es_snapshot_repo]\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: BlobStoreException[Failed to create directory at [/mount/backups/my_backup]]; ",
"status":500
}
-
首先创建一个备份文件夹(一般该文件夹创建用户主文件夹)
mkdir ~/backup
-
授予该文件夹的权限
chmod 777 ~/backup
-
创建存储库(存储库代表您的路径)
curl -XPUT http://xx.xx.xx.xx:9200/_snapshot/es_snap -d
'{"type":"fs","settings":{"location":"home/user/backup"
,"compress":true}}'
-
Snapshot
curl -XPUT "http://xx.xx.xx.xx:9200/_snapshot/en_snap/snapshot_1" -d
'{"indices":["index1","index2","index3"],"ignore_unavailable":true,
"include_global_state": false,}'
-
Restore
curl -XPOST "http://xx.xx.xx.xx:9200/_snapshot/es_snap/snapshot_1/_restore" -d
'{"indices":["index1","index2"],"ignore_unavailable":true,
"include_global_state": false}'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)