前言
Elasticsearch 7.10.1
ES 所在服务器操作系统为 Ubuntu 20.04
Windows 服务器版本为 Windows Server 2019
修改 ES 服务配置
- 在
elasticsearch.yml
文件中添加如下配置,并重启 ES 服务
path.repo:
- /mnt/winshare
注册快照仓库
PUT /_snapshot/my_backup
{
"type": "fs",
"settings": {
"location": "/mnt/winshare/es_snapshot"
}
}
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
创建快照
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
恢复快照
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"
}
PUT zt_product_doc_index_20210223_3_restore/_settings
{
"index.number_of_replicas" : "1"
}
本文出自 qbit snap