curl -XDELETE http://192.168.10.49:9200/_snapshot/my_backup/snapshot_20161207 6、恢复备份
curl -XPOST http://192.168.10.49:9200/_snapshot/my_backup/snapshot_20160812/_restore 如果你的是集群而且在创建仓库的时候没有配置共享文件夹那会报下面的错误
{"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 [/mnt/bak] 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]; nested: RepositoryException[[my_backup] location [/mnt/bak] doesn't match any of the locations specified by path.repo because this setting is empty]; ","status":500} 解决方法关闭支点服务器elasticsearch服务重新执行即可成功。
如果已经存在.kibana索引可以先关闭掉。
成功恢复数据后只有主节点服务器存在.kibana索引。我们希望所有的节点服务器都存在此索引时执行下面的命令
curl -XPUT 'http://192.168.10.49:9200/.kibanna/_settings' -d '
{
"index" : {
"number_of_replicas" : 1
}
}'