1. 서버에서 curl 명령어를 통해 복원하기
#전체 복구하기
curl --user '{user}:{password}' --header "content-type: application/JSON" -XPOST 'localhost:9200/_snapshot/{snapshot_name}/{backup_key}/_restore?wait_for_completion=true'
#인덱스 지정 복구하기
curl --user '{user}:{password}' --header "content-type: application/JSON" -XPOST 'localhost:9200/_snapshot/{snapshot_name}/{backup_key}/{index_name}/_restore?wait_for_completion=true' -d '{
"indices": "backup_2023.03",
"ignore_unavailable" : "true",
"include_global_state" : false,
"rename_pattern": "backup_(.+)",
"rename_replacement": "backup_$1"
}'
- wait_for_completion : 작업이 완료될때까지 기달림
- ignore_unavailable : index를 이용하지 못할때 그냥 ignore하고 계속 진행 (true)
- include_global_state : snapshot에 cluster global status 저장되는거 방지(false)
- rename_pattern : 해당 패턴으로 시작하는
- rename_replacement : 해당 이름으로 변경
2. kibana 웹 페이지에서 복원하기
- Elasticsearch > Snapshot and Resotre 선택
- 백업받을 Snapshot 선택
- Restore 선택
- Indices 부분은 default가 all로 되어있음
- default all을 해제하면 원하는 인덱스 부분만 선택해서 백업도 가능
'Elasticsearch' 카테고리의 다른 글
this action would add [1] total shards, but this cluster currently has [1000]/[1000] maximum shards open (0) | 2023.06.22 |
---|---|
Elasticsearch index backup(NCP Storage 기준) (2) | 2023.05.17 |
Elasticsearch index backup(AWS S3 사용) (0) | 2023.05.16 |