前言
Elasticsearch 7.10.1ES 所在服务器操作系统为 Ubuntu 20.04Windows 服务器版本为 Windows Server 2019
- 已将
Windows
的 //172.31.19.143/es_snapshot
共享目录挂载到 ES 服务器的 /mnt/winshare
目录 - Linux 挂载 Windows 共享目录参见: Ubuntu 20.04 读写 Windows 10 共享目录
批改 ES 服务配置
- 在
elasticsearch.yml
文件中增加如下配置,并重启 ES 服务
path.repo: - /mnt/winshare
注册快照仓库
- 官网文档: https://www.elastic.co/guide/...
PUT /_snapshot/my_backup{ "type": "fs", "settings": { "location": "/mnt/winshare/es_snapshot", "max_snapshot_bytes_per_sec": "100mb", # 调整快照创立的速度,默认 40mb "max_restore_bytes_per_sec": "200mb", # 调整快照复原的速度,默认无限度 }}
GET _snapshot/_all
PUT _cluster/settings{ "transient": { "indices.recovery.max_bytes_per_sec": "200mb", # 默认 40mb "cluster.routing.allocation.node_concurrent_recoveries": "5" # 默认 2 }}
GET _cluster/settings?flat_settings&include_defaults
创立快照
- 官网文档: https://www.elastic.co/guide/...
PUT /_snapshot/my_backup/snapshot_zt{ "indices": "zt_product_doc_index_20210223_3"}
GET _snapshot/my_backup/_all
GET _snapshot/my_backup/snapshot_zt
GET _snapshot/my_backup/snapshot_zt/_status
复原快照
- 官网文档: https://www.elastic.co/guide/...
POST /_snapshot/my_backup/snapshot_zt/_restore{ "indices": "zt_product_doc_index_20210223_3", "index_settings": { "index.number_of_replicas": 0 }, "rename_pattern": "zt_product_doc_index_20210223_3", "rename_replacement": "zt_product_doc_index_20210223_3_restore"}
本文出自 qbit snap