How Do I Back Up a Large Amount of Data Using Snapshots?
Improve snapshot backup configurations to ensure that each snapshot takes less than 24 hours to create. For example:
- Specify indexes and back up data in batches. The default value is *, indicating that all indexes are backed up.
- Use a custom snapshot repository.
- Create a custom repository.
CSS provides the repo_auto repository by default. You can create one by calling the following API:
PUT _snapshot/my_backup { "type" : "obs", "settings" : { "bucket" : "css-backup-name", // Bucket name "base_path" : "css_backup/711/", // Backup path "chunk_size" : "2g", "endpoint" : "obs.xxx.huawei.com:443", //OBS domain name address "region" : "xxx", //Region name "compress" : "true", "access_key": "xxxxx", //AK "secret_key": "xxxxxxxxxxxxxxxxx" //SK "max_restore_bytes_per_sec": "100mb", // OBS speed. The default value is 40 MB. You can increase the value if your cluster can achieve higher performance. "max_snapshot_bytes_per_sec": "100mb" } }
- Create a snapshot using a custom repository.
PUT _snapshot/my_backup/Snapshot_name { "indices": "*", // Backup index. The asterisk (*) indicates indexes. Multiple indexes are separated by commas (,). "ignore_unavailable": true, // Whether to ignore the availability of a single index. The value true indicates that the availability is ignored. "include_global_state": false //: The default value is false, indicating that the cluster state and some other states are not saved. }
- Query the snapshot status.
GET _snapshot/my_backup/snapshot_name/_status
- Restore indexes in the custom repository.
POST /_snapshot/my_backup/snapshot_name/_restore { "indices": "test-00000000000", "ignore_unavailable": true, "include_global_state": false, "rename_pattern": "(.+)", "rename_replacement": "$1" }
- Create a custom repository.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.