指定index进行备份
- 设置备份保存路径。如下设置备份文件夹名为graph_backup,存储文件路径/data/duser/industry_es_backup
PUT /_snapshot/my_backup
{
"type": "fs",
"settings": {
"location": "/data/duser/industry_es_backup"
}
}
PUT /_snapshot/my_backup/snapshot_graph
{
"indices": "devjanus_qiye_mixedcodeqiye1607495310,devjanus_renwu_mixedcoderenwu1607485038,devjanus_industry_supply_chain_1130_mixedcodeindustry_supply_chain_11301606705883"
}
快照恢复
curl -XPUT -u username:password
"http://host:9200/_snapshot/my_backup" -H 'Content-Type:
application/json' -d '
{
"type": "fs",
"settings": {
"location": "/data/duser/preprocess/es"
}
}
## 如下修改前缀
POST /_snapshot/my_backup/snapshot_graph/_restore
{
"indices":
"devjanus_qiye_mixedcodeqiye1607495310,devjanus_renwu_mixedcoderenwu1607485
038,devjanus_industry_supply_chain_1130_mixedcodeindustry_supply_chain_1130
1606705883",
"rename_pattern": "devjanus_(.+)",
"rename_replacement": "a_zc_$1"
}
## 如下也是替换前缀
POST /_snapshot/my_backup/snapshot_industry/_restore
{
"indices":
"industry_company_v1,industry_v2,main_product_cal_v6,product_v2,company_finance
_cal_v4",
"rename_pattern": "(.+)_v[0-9]",
"rename_replacement": "a_zc_$1"
}
网友评论