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
相关推荐
Elasticsearch7 小时前
Elastic 的托管 OTLP 端点:为 SRE 提供更简单、可扩展的 OpenTelemetry
elasticsearch
Yusei_052310 小时前
迅速掌握Git通用指令
大数据·git·elasticsearch
水无痕simon1 天前
5 索引的操作
数据库·elasticsearch
Qlittleboy3 天前
tp5集成elasticsearch笔记
大数据·笔记·elasticsearch
Elasticsearch3 天前
Elasticsearch:使用 Gradio 来创建一个简单的 RAG 应用界面
elasticsearch
kong@react3 天前
spring boot配置es
spring boot·后端·elasticsearch
Elasticsearch3 天前
Elasticsearch:如何使用 Qwen3 来做向量搜索
elasticsearch
Elastic 中国社区官方博客3 天前
Elasticsearch:如何使用 Qwen3 来做向量搜索
大数据·人工智能·elasticsearch·搜索引擎·全文检索
xiao-xiang4 天前
elasticsearch mapping和template解析(自动分词)!
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客4 天前
超越相似名称:Elasticsearch semantic text 如何在简洁、高效、集成方面超越 OpenSearch semantic 字段
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索