| | 142 | |
| | 143 | Snapshot |
| | 144 | {{{ |
| | 145 | curl -X PUT "localhost:9200/_snapshot/backup-repo?pretty" -H 'Content-Type: application/json' -d' |
| | 146 | { |
| | 147 | "type": "fs", |
| | 148 | "settings": { |
| | 149 | "location": "/usr/share/elasticsearch/data/repo", |
| | 150 | "compress": true |
| | 151 | } |
| | 152 | }' |
| | 153 | |
| | 154 | |
| | 155 | # config snapshot |
| | 156 | curl -X PUT "localhost:9200/_snapshot/backup-repo/snapshot-1?pretty" |
| | 157 | |
| | 158 | # cmd to take snapshot |
| | 159 | curl -X GET "localhost:9200/_snapshot/backup-repo/snapshot-1?pretty" |
| | 160 | |
| | 161 | # check snapshot status |
| | 162 | curl -X GET "localhost:9200/_snapshot/backup-repo/snapshot-1/_status?pretty" |
| | 163 | |
| | 164 | # stop all indices |
| | 165 | curl -X POST "localhost:9200/_all/_close?pretty" |
| | 166 | |
| | 167 | # restore snapshot make sure to CLOSE all indices BEFORE restore |
| | 168 | curl -X POST "localhost:9200/_snapshot/backup-repo/snapshot-1/_restore?pretty" |
| | 169 | |
| | 170 | # start open indices NO NEED |
| | 171 | curl -X POST "localhost:9200/_all/_open?pretty" |
| | 172 | |
| | 173 | |
| | 174 | }}} |