当前位置:网站首页>Es snapshot based data backup and restore
Es snapshot based data backup and restore
2022-06-26 13:22:00 【Elastic open source community】
1、 What is a snapshot
snapshot Is from the running Elasticsearch The backup obtained in the cluster . You can take snapshots of the entire cluster , You can also target the data flow and index of the entire cluster . You can also snapshot only specific data streams or indexes in the cluster .
The only reliable and supported way to back up a cluster is to take snapshots . You cannot back up by copying the data directory of its node Elasticsearch colony . The method of recovering any data from a file system level backup is not supported . If you try to recover a cluster from such a backup , It may fail by reporting corrupt or missing files or other data inconsistencies , Or it may seem that it has succeeded in silently losing some data .
The data directory copy of the cluster node cannot be used as a backup , Because it is not a consistent representation of its content at a single point in time . You cannot solve this problem by shutting down the node while making a replica , Nor can it be solved by taking an atomic file system level snapshot , because Elasticsearch Have consistency requirements across the entire cluster . The built-in snapshot function must be used for cluster backup
2、 Snapshot compatibility
The snapshot contains a copy of the disk data structure , These data structures form a back-up index to an index or data stream . This means that the snapshot can only be recovered to the point where the index can be read Elasticsearch edition .
The following table shows snapshot compatibility between versions . The first column indicates the base version from which you can restore the snapshot .

3、 Snapshot based backup and restore
3.1 Register storage warehouse
path.repo: ["~/es/backup"]
Be careful :
- Ensure that the currently configured warehouse directory exists , If it doesn't exist , It needs to be created in advance
- If the cluster contains multiple nodes , You need to configure the shared directory , Single node does not need
3.2 Register the snapshot Repository
PUT /_snapshot/my_backup
{
"type": "fs",
"settings": {
"location": "~/es/backup"
}
}
3.3 Create a snapshot
PUT /_snapshot/my_backup/snapshot_1?wait_for_completion=true
3.4 Restore snapshot
POST /_snapshot/my_backup/snapshot_1/_restore
Specify the index or data stream to restore
POST /_snapshot/my_backup/snapshot_1/_restore
{
"indices": "data_stream_1,index_1,index_2",
"ignore_unavailable": true,
"include_global_state": false,
"rename_pattern": "index_(.+)",
"rename_replacement": "restored_index_$1",
"include_aliases": false
}
边栏推荐
- [how to connect the network] Chapter 2 (Part 1): establish a connection, transmit data, and disconnect
- H5 video automatic playback and circular playback
- 【Spark】. Explanation of several icons of scala file in idea
- Typescript
- HDU 3709 Balanced Number
- Arcpy -- use of insertlayer() function: adding layers to map documents
- C language: Exercise 2
- MariaDB study notes
- 10秒内完成火灾预警,百度智能云助力昆明官渡打造智慧城市新标杆
- Stack, LIFO
猜你喜欢

NVM installation tutorial

Machine learning notes - seasonality of time series

Processing random generation line animation

mysql讲解(一)

Explain C language 11 in detail (C language series)

组合模式(Composite )

What features are added to Photoshop 2022 23.4.1? Do you know anything

Prototype

Processsing mouse interactive learning

Composite mode
随机推荐
ES6 module
tauri vs electron
MySQL数据库讲解(三)
Processing function translate (mousex, mousey) learning
5+api, clear application cache
C - Common Subsequence
Analysis of state transition diagram of Beifu NC axis
Common creation and usage of singletons
Beifu PLC realizes data power-off maintenance based on cx5130
Prototype
KITTI Detection dataset whose format is letf_ top_ right_ bottom to JDE normalied xc_ yc_ w_ h
A primary multithreaded server model
[shell] generate strings between specified dates
Beifu cx5130 card replacement and transfer of existing authorization files
NVM installation tutorial
Electron official docs series: Testing And Debugging
Ubuntu installation and configuration PostgreSQL (18.04)
Electron official docs series: Contributing
SQL assigns the field value of data table B to a column in data table a
MySQL数据库讲解(六)