当前位置:网站首页>ES基于Snapshot(快照)的数据备份和还原
ES基于Snapshot(快照)的数据备份和还原
2022-06-26 12:40: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
}
边栏推荐
- Do you know the limitations of automated testing?
- H - Sumsets POJ 2229
- Basic configuration and test of Beifu twincat3 NCI in NC axis interface
- Electron official docs series: Get Started
- Chapter 01_ Installation and use of MySQL under Linux
- Summary of wechat applet test points
- Arcpy——InsertLayer()函數的使用:摻入圖層到地圖文檔裏
- 中国剩余定理模板题 互质与非互质
- 防火墙介绍
- Sinotech software outsourcing
猜你喜欢

Script - crawl the customized storage path of the cartoon and download it to the local
![HDU1724[辛普森公式求积分]Ellipse](/img/57/fb5098e150b5f3d91a5d0983a336ee.png)
HDU1724[辛普森公式求积分]Ellipse

LAMP编译安装

Dark horse notes - Common APIs

Basic configuration and test of Beifu twincat3 NCI in NC axis interface

Do you know the limitations of automated testing?

MySQL讲解(二)

Common faults of MySQL database - forgetting database password

May product upgrade observation station

Electron official docs series: Processes in Electron
随机推荐
[how to connect the network] Chapter 2 (next): receiving a network packet
D - skiing
Reflect the technical depth (unable to speed up)
Don't mess with full_ Case and parallel_ CASE
Electron official docs series: Contributing
10秒内完成火灾预警,百度智能云助力昆明官渡打造智慧城市新标杆
I - Dollar Dayz
Opencv high speed download
MySQL数据库讲解(四)
Mysql database explanation (III)
B - Bridging signals
Beifu PLC based on NT_ Shutdown to realize automatic shutdown and restart of controller
HDU 3709 Balanced Number
2. Introduction to parallel interface, protocol and related chips (8080, 8060)
ES6:Map
MySQL数据库讲解(三)
Analysis of state transition diagram of Beifu NC axis
Processing function translate (mousex, mousey) learning
防火墙介绍
2、并行接口、协议和相关芯片介绍(8080、8060)