《Elastic Stack 实战手册》——三、产品能力——3.4.入门篇——3.4.1.Elastic Stack 安装部署——3.4.1.8. ECK 安装(14) https://developer.aliyun.com/article/1231267
查看创建的 snapshot:
恢复 snapshot
删除原索引 my-index:
DELETE my-index
从快照 snapshot_1 中恢复 my-index 到 restored-my-index 索引:
POST _snapshot/eck-repository/snapshot_1/_restore { "indices": "my-index", "ignore_unavailable": true, "rename_pattern": "(.+)", "rename_replacement": "restored_$1" }
查看恢复快照后的数据,可以看到和索引 my-index 删除前的数据一致,成功通过快照恢复了数据。
GET restored_my-index/_search #返回结果 { "took" : 2, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 3, "relation" : "eq" }, "max_score" : 1.0, "hits" : [ { "_index" : "restored_my-index", "_type" : "_doc", "_id" : "nZmSXHsBwrlfk6F5cFkI", "_score" : 1.0, "_source" : { "name" : "Tom", "age" : 18 } }, { "_index" : "restored_my-index", "_type" : "_doc", "_id" : "npmSXHsBwrlfk6F5cFkI", "_score" : 1.0, "_source" : { "name" : "Jack", "age" : 20 } }, { "_index" : "restored_my-index", "_type" : "_doc", "_id" : "n5mSXHsBwrlfk6F5cFkI", "_score" : 1.0, "_source" : { "name" : "Mark", "age" : 21 } } ] } }
《Elastic Stack 实战手册》——三、产品能力——3.4.入门篇——3.4.1.Elastic Stack 安装部署——3.4.1.8. ECK 安装(16) https://developer.aliyun.com/article/1231264