30-集群Backup & Restore

在 elasticsearch.yml 加入相关的配置

复制代码
#在 elasticsearch.yml 加入相关的配置
path.repo: ["/Users/zwy/es/mount/my_backup"]

创建一个 repositoty

复制代码
#创建一个 repositoty
PUT /_snapshot/my_fs_backup
{
    "type": "fs",
    "settings": {
        "location": "/Users/zwy/es/mount/my_backup",
        "compress": true
    }
}

创建一个snapshot

复制代码
# 创建一个snapshot
PUT /_snapshot/my_fs_backup/snapshot_1?wait_for_completion=true

DELETE test
PUT test/_doc/1
{
  "key":"value1"
}

指定索引创建快照

复制代码
#指定索引创建快照
PUT /_snapshot/my_fs_backup/snapshot_2?wait_for_completion=true
{
  "indices": "test",
  "ignore_unavailable": true,
  "include_global_state": false,
  "metadata": {
    "taken_by": "yiming",
    "taken_because": "backup before upgrading"
  }
}

查看所有的快照

复制代码
#查看所有的快照
GET /_snapshot/my_fs_backup/_all

# 删除快照
DELETE /_snapshot/my_fs_backup/snapshot_2


POST /_snapshot/my_fs_backup/snapshot_1/_restore
{
  
}

指定索引进行 restore

复制代码
# 指定索引进行 restore
POST /_snapshot/my_fs_backup/snapshot_1/_restore
{
  "indices": "test",
  "index_settings": {
    "index.number_of_replicas": 5
  },
  "ignore_index_settings": [
    "index.refresh_interval"
  ]
}

DELETE test

# 删除快照
DELETE /_snapshot/my_fs_backup
相关推荐
Elastic 中国社区官方博客9 小时前
让大模型思考,让小模型执行:在 Elastic Workflows 中拆分 LLM 成本
大数据·运维·数据库·人工智能·elasticsearch·ai
IZero0710 小时前
Elasticsearch 学习笔记筑基-文档操作篇
笔记·学习·elasticsearch
醉颜凉10 小时前
Elasticsearch 核心基石:倒排索引全解析(原理+结构+流程图+实战)
elasticsearch·jenkins·流程图
醉颜凉10 小时前
Elasticsearch底层原理:文档更新与删除完整执行流程深度剖析
大数据·elasticsearch·jenkins
2601_9609067217 小时前
全球AI产业正加速迈入全域渗透
elasticsearch·百度·database·时序数据库·memcache
Elasticsearch19 小时前
打通 AI Agent 落地生产的“最后一步”:Elastic Stack 中的 Human-in-the-Loop (HITL) 审批工作流实战
elasticsearch
Elasticsearch19 小时前
构建值得信赖的金融服务领域 agentic AI:从数据到自主行动
elasticsearch
普通网友1 天前
Springboot中使用Elasticsearch(部署+使用+讲解 最完整)
spring boot·elasticsearch·jenkins
虫小宝1 天前
优惠券省钱APP查询性能优化:Elasticsearch与Canal实现的多维度商品搜索毫秒级响应方案
elasticsearch·性能优化·jenkins
leoZ2312 天前
10-Git 仓库蒸馏术:从代码仓库到 OpenClaw 虚拟人-蒸馏工具链
大数据·git·深度学习·神经网络·目标检测·elasticsearch·lstm