es backup and restore
-
shared file system repository
path.repo: ["/mount/backups", "/mount/longterm_backups"] -
You must register a snapshot repository before you can perform snapshot and restore operations.
PUT /_snapshot/my_backup
{
"type": "fs",
"settings": {
"location": "my_backup_location"
}
}
2.1 To retrieve information about a registered repository, use a GET request:
GET /_snapshot/my_backup
siuvo_daily_backup
which returns:
{
"my_backup": {
"type": "fs",
"settings": {
"location": "my_backup_location"
}
}
}
2.2 To retrieve information about multiple repositories, specify a comma-delimited list of repositories.
GET /_snapshot/repo,backup*
GET /_snapshot
GET /_snapshot/_all
2.3 After all nodes are restarted, the following command can be
used to register the shared file system repository with the name my_fs_backup:
PUT /_snapshot/my_fs_backup
{
"type": "fs",
"settings": {
"location": "/mount/backups/my_fs_backup_location",
"compress": true
}
}
2.4 Repository Verificationedit
The verification process can also be executed manually by running the following command:
POST /_snapshot/my_unverified_backup/_verify
- snapshot
PUT /_snapshot/my_backup/snapshot_1?wait_for_completion=true
3.1 By default a snapshot of all open and started indices in the cluster is created.
PUT /_snapshot/my_backup/snapshot_2?wait_for_completion=true
{
"indices": "index_1,index_2",
"ignore_unavailable": true,
"include_global_state": false
}
curl -X PUT "localhost:9200/_snapshot/my_backup/snapshot_2?wait_for_completion=true" -H 'Content-Type: application/json' -d'
{
"indices": "smhc.ops4,smhc.ops5",
"ignore_unavailable": true,
"include_global_state": false
}
'
PUT /_snapshot/my_backup/<snapshot-{now/d}>
curl -X PUT "localhost:9200/_snapshot/my_backup/%3Csnapshot-%7Bnow%2Fd%7D%3E"
3.2 snapshot can be obtained using the following command
curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1"
curl -X GET "localhost:9200/snapshot/my_backup/snapshot*,some_other_snapshot"
curl -X GET "localhost:9200/_snapshot/my_backup/_all"
A currently running snapshot can be retrieved using the following command:
curl -X GET "localhost:9200/_snapshot/my_backup/_current"
3.3 A snapshot can be deleted from the repository using the following command:
curl -X DELETE "localhost:9200/_snapshot/my_backup/snapshot_2"
A repository can be unregistered using the following command:
curl -X DELETE "localhost:9200/_snapshot/my_backup"
3.4 snapshots with their detailed status information
curl -X GET "localhost:9200/_snapshot/_status"
curl -X GET "localhost:9200/_snapshot/my_backup/_status"
curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1/_status"
Multiple ids are also supported:
curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1,snapshot_2/_status"
curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1"
curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1/_status"
curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/%3Csnapshot-%7Bnow%2Fd%7D%3E'
PUT /_snapshot/my_backup/<snapshot-{now/d}>
curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/%3Csnapshot-%7Bnow%2Fd%7D%3E'
curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/%253Csnapshot-%257Bnow%252Fd%257D%253E'
curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/<snapshot-{now/d}>'
curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/snapshot-now/d'
网友评论