Elasticsearch Snapshot Introduction
snapshots are typically built on a shared file system , In this case there is a snapshot of the node , Other nodes are also visible. , This can be deleted at the same time, (in the latest version of the creation of the warehouse if you do not use the shared file system will prompt you, the other nodes do not find the corresponding warehouse).
Registering a snapshot warehouse
pay attention to this " Location "Directory must be" Path.repo "Inside the specified, or subdirectory.
[[Email protected]elasticsearch]# curl-xput ' http://localhost:9200/_snapshot/my_backup '-d ' {' type ': ' FS ', ' Settings ' : {"Location": "/data1/backup/nginx-log", "Compress": true}} '
View the Snapshot Warehouse
" Compress " --whether to compress
[[Email protected]elasticsearch]# curl-xget ' http://localhost:9200/_snapshot/my_backup?pretty '-d ' {"My_backup": {" Type ":" FS "," setting ": {" compress ":" true "," Location ":"/data1/backup/nginx-log "}} '
3. Create a Snapshot
[Email protected]~]# curl-xput "Localhost:9200/_snapshot/my_backup/nginx-log"-d ' {> "indices": "Nginx-log",> "Include_global_state": false>} '
View Snapshots
[[email protected]indices]# curl -xget "Localhost:9200/_snapshot/my_backup/nginx-log"? pretty=1{ "Snapshots" : [ { "snapshot" : "Nginx-log", "version_id" : 1070199, "version" : "1.7.1" , "Indices" : ["Nginx-access-log" ], "state" : "SUCCESS", "Start_time"  : "2015-08-25t15:16:46.846z", "Start_time_in_millis" :1440515806846, "End_time"  : "2015-08-25t15 : 16:47.458z ", " End_time_in_millis " :1440515807458, " Duration_in_millis " : 612, " failures " : [ ], "Shards" : { "Total" : 5, "Failed" : 0, "Successful"  : 5    }  } ]
}
4. Recovering a Snapshot
Because there's only one index in the snapshot, so no matter how you restore it all
[[Email protected]indices]# curl-xpost "Localhost:9200/_snapshot/my_backup/nginx-log/_restore" {"Accepted": true}
When you have more than one index in the snapshot, you can use the following way ~ ~ ~
curl-xpost "localhost:9200/_snapshot/my_backup/ Nginx-log /_restore " - d ' {
"Indices": "index_1,index_2",
"Ignore_unavailable": "true",
"Include_global_state": false,
"Rename_pattern": "Index_ (. +)",
"Rename_replacement": "Restored_index_$1"
}‘
5. Delete all snapshots
[[email protected] indices]# curl-xdelete http://127.0.0.1:9200/_snapshot/my_backup/nginx-log{"acknowledged": true}
This article is from the "Nginxs Small white" blog, please be sure to keep this source http://nginxs.blog.51cto.com/4676810/1688282
Elasticsearch Index Creation Snapshot