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
相关推荐
星辰_mya4 小时前
Elasticsearch主分片数写入后不能改
大数据·elasticsearch·搜索引擎
春日见15 小时前
vscode代码无法跳转
大数据·人工智能·深度学习·elasticsearch·搜索引擎
那起舞的日子21 小时前
ElasticSearch系列-3-java端整合CURD
elasticsearch
历程里程碑1 天前
普通数组----最大子数组和
大数据·算法·elasticsearch·搜索引擎·排序算法·哈希算法·散列表
星辰_mya1 天前
Elasticsearch之下
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客1 天前
跳过 MLOps:通过 Cloud Connect 使用 EIS 为自管理 Elasticsearch 提供托管云推理
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
Elastic 中国社区官方博客1 天前
Elasticsearch:使用 Base64 编码字符串加速向量摄取
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
Elastic 中国社区官方博客1 天前
介绍 Elastic Workflows:用于 Elasticsearch 的原生自动化
大数据·人工智能·elasticsearch·搜索引擎·ai·自动化·全文检索
Cx330❀1 天前
从零实现Shell命令行解释器:原理与实战(附源码)
大数据·linux·数据库·人工智能·科技·elasticsearch·搜索引擎
岱宗夫up1 天前
.env 文件是干啥的?为什么不能提交到 Git?
大数据·git·elasticsearch·搜索引擎·gitee·github·gitcode