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
相关推荐
ALex_zry10 小时前
Git大型仓库推送失败问题完整解决方案
大数据·git·elasticsearch
二进制coder11 小时前
Git Fork 开发全流程教程
大数据·git·elasticsearch
Elasticsearch19 小时前
混合搜索无需头疼:使用 retrievers 简化混合搜索
elasticsearch
Elastic 中国社区官方博客20 小时前
使用 A2A 协议和 MCP 在 Elasticsearch 中创建一个 LLM agent 新闻室:第二部分
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
q***65692 天前
使用Canal将MySQL数据同步到ES(Linux)
linux·mysql·elasticsearch
周全全2 天前
基于ElasticSearch的语义检索学习-向量化数据、向量化相似度、向量化检索
大数据·学习·elasticsearch
TH_12 天前
腾讯云-(10)-宝塔面板-Docker下安装Elasticsearch
elasticsearch·docker·容器
risc1234562 天前
【Elasticsearch】AwarenessAllocationDecider 感知分片决策器的处理逻辑
elasticsearch
transitory_truth2 天前
es-api介绍
elasticsearch
q***47183 天前
使用Canal将MySQL数据同步到ES(Linux)
linux·mysql·elasticsearch