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 中国社区官方博客4 小时前
使用真实 Elasticsearch 进行高级集成测试
大数据·数据库·elasticsearch·搜索引擎·全文检索·jenkins·集成测试
画船听雨眠aa11 小时前
gitlab云服务器配置
服务器·git·elasticsearch·gitlab
risc12345615 小时前
【Elasticsearch 】悬挂索引(Dangling Indices)
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客17 小时前
使用 Ollama 和 Kibana 在本地为 RAG 测试 DeepSeek R1
大数据·数据库·人工智能·elasticsearch·ai·云原生·全文检索
zfj32117 小时前
学技术学英语:elasticsearch硬件相关的配置&优化技巧
网络·elasticsearch·全文检索·内存·cpu·磁盘
字节全栈_vBr1 天前
面试之Solr&Elasticsearch
elasticsearch·面试·solr
risc1234561 天前
【Elasticsearch】中数据流需要配置索引模板吗?
大数据·elasticsearch·jenkins
JackieZhengChina1 天前
新一代搜索引擎,是 ES 的15倍?
大数据·elasticsearch·搜索引擎
是小崔啊1 天前
Spring Boot - 数据库集成06 - 集成ElasticSearch
数据库·spring boot·elasticsearch
Elastic 中国社区官方博客1 天前
Elastic Cloud Serverless 获得主要合规认证
大数据·数据库·elasticsearch·搜索引擎·云原生·serverless·全文检索