当前位置:网站首页>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
}
边栏推荐
- Adapter mode
- zoopeeper设置acl权限控制(只允许特定ip访问,加强安全)
- 外观模式(Facade)
- Uva11582 [fast power]colossal Fibonacci numbers!
- Beifu realizes the control of time slice size and quantity through CTU and ton
- 解中小企业之困,百度智能云打个样
- Word document export (using fixed template)
- Es6: iterator
- 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

Log in to the server using SSH key pair

5月产品升级观察站

2、并行接口、协议和相关芯片介绍(8080、8060)

MariaDB study notes

Processsing function random

Bifu divides EtherCAT module into multiple synchronization units for operation -- use of sync units

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

2. Introduction to parallel interface, protocol and related chips (8080, 8060)

Arcpy——InsertLayer()函數的使用:摻入圖層到地圖文檔裏
随机推荐
MySQL数据库讲解(四)
解中小企业之困,百度智能云打个样
SQL assigns the field value of data table B to a column in data table a
ES6:Map
Vivado error code [drc pdcn-2721] resolution
Arcpy——InsertLayer()函數的使用:摻入圖層到地圖文檔裏
利用scrapy爬取句子迷网站优美句子存储到本地(喜欢摘抄的人有福了!)
J - Wooden Sticks poj 1065
Prototype
Bifu divides EtherCAT module into multiple synchronization units for operation -- use of sync units
POJ 3070 Fibonacci
C - Common Subsequence
Uva10341 solve it
H5视频自动播放和循环播放
Analysis and protection of heart blood dripping vulnerability (cve-2014-0160)
Common faults of MySQL database - forgetting database password
10秒内完成火灾预警,百度智能云助力昆明官渡打造智慧城市新标杆
F - Charm Bracelet
Beifu PLC realizes data power-off maintenance based on cx5130
Thinking caused by the error < note: candidate expectations 1 argument, 0 provided >