es建立快照仓库和数据的备份还原

创建仓库

PUT /_snapshot/ihe_backup
{
“type”: “hdfs”,
“settings”: {
“path”: “elasticsearch/repositories/ih”,
“load_defaults”: “true”,
“compress”: “true”,
“uri”: “hdfs://192.1.25.167:8020/”,
“conf.dfs.domain.socket.path”: “/var/lib/hadoop-hdfs/dn_socket”,
“conf.dfs.client.read.shortcircuit”: “true”,
“max_restore_bytes_per_sec” : “500mb”,
“chunk_size” : “128m”,
“max_snapshot_bytes_per_sec” : “500mb”
}
}

备份

PUT /_snapshot/ihe_backup/ih-2019.08.04-bak?wait_for_completion=true
{
“indices”: “ih-2019.08.04”,
“ignore_unavailable”: true,
“include_global_state”: false
}

查看状态

GET /_snapshot/ihe_backup/ih-2019.08.04-bak/_status

还原

POST /_snapshot/ihe_backup/ih-2019.08.04-bak/_restore
{
“indices”: “ih-2019.08.04”,
“ignore_unavailable”: true,
“include_global_state”: false,
“rename_pattern”: “ih-(.+)”,
“rename_replacement”: “snapshot-ih-$1”
}

你可能感兴趣的:(es建立快照仓库和数据的备份还原)