适用于
:集群整体备份与迁移,包括:全量、增量贝恩和恢复。适用于
:索引层面迁移数据或Mapping,支持:analyzer/Mapping/data的迁移操作。适用于
:本地索引更新Mapping实现索引层面迁移,或者跨集群的索引迁移。备份集群
的唯一可靠方法是使用快照和还原功能。增量
创建的。这意味着,当创建索引快照时,Elasticsearch避免复制任何已存储在存储库中的数据作为同一索引的早期快照的一部分。因此,可以非常频繁
地为集群创建快照。1path.repo: ["D:\\install\\elasticsearch-7.2.0-windows-x86_64\\elasticsearch-7.2.0\\backup"]
1PUT /_snapshot/my_backup
2{
3 "type": "fs",
4 "settings": {
5 "location": "D:\\install\\elasticsearch-7.2.0-windows-x86_64\\elasticsearch-7.2.0\\backup"
6 }
7}
1PUT /_snapshot/my_backup/snapshot_cluster?wait_for_completion=true
1快照索引信息
2快照执行起始时间、持续时间
3成功、失败分片数等
1PUT /_snapshot/my_backup/snapshot_hamlet_index?wait_for_completion=true
2{
3 "indices": "hamlet_*",
4 "ignore_unavailable": true,
5 "include_global_state": false,
6 "metadata": {
7 "taken_by": "mingyi",
8 "taken_because": "backup before upgrading"
9 }
10}
1DELETE hamlet_*
2POST /_snapshot/my_backup/snapshot_hamlet_index/_restore
1{
2 "accepted" : true
3}
1POST /_snapshot/my_backup/snapshot_cluster/_restore
1GET /_snapshot/_all
1GET /_snapshot/my_backup/snapshot_hamlet_index/_status
1DELETE /_snapshot/my_backup/snapshot_hamlet_index
1elasticdump \
2 --input=http://192.168.1.1:9200/my_index \
3 --output=http://192.168.3.2:9200/my_index \
4 --type=analyzer
5elasticdump \
6 --input=http://192.168.1.1:9200/my_index \
7 --output=http://192.168.3.2:9200/my_index \
8 --type=settings
9elasticdump \
10 --input=http://192.168.1.1:9200/my_index \
11 --output=http://192.168.3.2:9200/my_index \
12 --type=mapping
1elasticdump \
2 --input=http://192.168.1.1:9200/my_index \
3 --output=http://192.168.3.2:9200/my_index \
4 --type=data
NFS共享
,确定每一个节点挂载到指定路径,才能创建快照存储库。1{
2 "error": {
3 "root_cause": [
4 {
5 "type": "snapshot_restore_exception",
6 "reason": "[my_backup:snapshot_cluster/_THlX1vMQvGmwxcRCmhnlA] cannot restore index [.kibana_task_manager] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"
7 }
8 ],
更短时间、更快习得更多干货!