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
相关推荐
Elasticsearch5 小时前
一文看懂 Elasticsearch BBQ 向量压缩如何降本增效
elasticsearch
wuyk5552 天前
Spider-第20讲-综合实战可上线爬虫
大数据·爬虫·python·elasticsearch
Elasticsearch2 天前
4 种模态、100 多种语言、1 个向量空间:Microsoft Foundry 中的 Jina Embeddings v5
elasticsearch
Elasticsearch3 天前
使用 Codex 来写入 PDF 文件并创建 AI Agent 对它进行问答
elasticsearch
草莓熊Lotso3 天前
【C++ 基于微服务的即时通讯系统】ElasticSearch 用户数据管理实现
linux·数据库·c++·elasticsearch·微服务·架构
岳涛3 天前
考古|搬迁 percolator 要先保住规则身份,ES 1.0 把它挪进了索引内
elasticsearch
岳涛3 天前
考古|旧查询和 _boost 在 ES 1.0 收掉,替换方向并不保证等价
elasticsearch
Elasticsearch3 天前
Elastic 与 HoneyHive 携手推进人工智能可观测性与评估
elasticsearch
wuyk5554 天前
Spider-第16讲-线程池与竞态问题
大数据·爬虫·python·elasticsearch·搜索引擎