当前位置:网站首页>ES基於Snapshot(快照)的數據備份和還原
ES基於Snapshot(快照)的數據備份和還原
2022-06-26 13:21:00 【Elastic開源社區】
1、快照是什麼
快照是從正在運行的 Elasticsearch 集群中獲取的備份。可以針對整個集群拍攝快照,也可以針對整個集群的數據流和索引。也可以僅對集群中的特定數據流或索引進行快照。
備份集群的唯一可靠且受支持的方法是拍攝快照。不可通過複制其節點的數據目錄來備份 Elasticsearch 集群。不支持從文件系統級備份中恢複任何數據的方法。如果您嘗試從此類備份中恢複集群,它可能會因報告損壞或丟失文件或其他數據不一致而失敗,或者它可能似乎已經成功地默默地丟失了一些數據。
集群節點的數據目錄副本不能用作備份,因為它不是其內容在單個時間點的一致錶示。您無法通過在制作副本時關閉節點來解决此問題,也無法通過獲取原子文件系統級快照來解决此問題,因為 Elasticsearch 具有跨越整個集群的一致性要求。必須使用內置快照功能進行集群備份
2、快照兼容性
快照包含磁盤數據結構的副本,這些數據結構構成索引或數據流的後備索引。這意味著快照只能恢複到可以讀取索引的 Elasticsearch 版本。
下錶顯示了版本之間的快照兼容性。第一列錶示您可以從中還原快照的基本版本。

3、基於快照的備份和還原
3.1 注册存儲倉庫
path.repo: ["~/es/backup"]
注意:
- 確保當前配置的倉庫目錄存在,如果不存在,需提前創建
- 如果集群中包含多個節點,則需配置共享目錄,單節點則不需要
3.2 注册快照存儲庫
PUT /_snapshot/my_backup
{
"type": "fs",
"settings": {
"location": "~/es/backup"
}
}
3.3 創建快照
PUT /_snapshot/my_backup/snapshot_1?wait_for_completion=true
3.4 還原快照
POST /_snapshot/my_backup/snapshot_1/_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
}
边栏推荐
- Analysis and protection of heart blood dripping vulnerability (cve-2014-0160)
- C - Common Subsequence
- Luogu p3426 [poi2005]sza-template solution
- Electron official docs series: Development
- H - Sumsets POJ 2229
- IDC report: the AI cloud market share of Baidu AI Cloud ranks first for six consecutive times
- Machine learning notes - seasonality of time series
- 【Spark】. Explanation of several icons of scala file in idea
- Common creation and usage of singletons
- 偶言佳句,孤芳自赏
猜你喜欢

Some conclusions about Nan

Basic methods for network diagnosis and hardware troubleshooting of Beifu EtherCAT module

Beifu realizes the control of time slice size and quantity through CTU and ton

10秒内完成火灾预警,百度智能云助力昆明官渡打造智慧城市新标杆
![[how to connect the network] Chapter 2 (middle): sending a network packet](/img/5f/602c59d3a7ee1154c7410fb2fcfc41.png)
[how to connect the network] Chapter 2 (middle): sending a network packet

IDC report: the AI cloud market share of Baidu AI Cloud ranks first for six consecutive times

Echart stack histogram: add white spacing effect setting between color blocks

mysql讲解(一)

To solve the difficulties of small and medium-sized enterprises, Baidu AI Cloud makes an example

What are the common categories of software testing?
随机推荐
Go structure method
Oplg: new generation cloud native observable best practices
Electron official docs series: References
5月产品升级观察站
Word document export (using fixed template)
首批通过!百度智能云曦灵平台获信通院数字人能力评测权威认证
Prototype
C - Common Subsequence
偶言佳句,孤芳自赏
Electron official docs series: Best Practices
ES6:Map
F - Charm Bracelet
Decorator
F - Charm Bracelet
解中小企业之困,百度智能云打个样
MySQL数据库常见故障——遗忘数据库密码
HDU 3555 Bomb
Beifu PLC model selection -- how to see whether the motor is a multi turn absolute value encoder or a single turn absolute value encoder
[how to connect the network] Chapter 1: the browser generates messages
MySQL explanation (II)