Elasticsearch Index Creation Snapshot

Source: Internet
Author: User

  1. 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).

  2. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.