AWS S3를 통해 elasticsearch index를 백업받는 부분은 아래 링크를 참고하시길 바란다.
https://babbeolicoding.tistory.com/33
Elasticsearch index backup(AWS S3 사용)
1. Elasticsearch config 수정 - jvm.options - elasticsearch.yml 각 config 위치에 아래 값 추가 - vim config/jvm.options => Des.allow_insecure_settings=true - vim config/elasticsearch.yml => network.host: 0.0.0.0 2. S3 플러그인 설치(elasticse
babbeolicoding.tistory.com
AWS 뿐 아니라 NCP Storage에 elasticsearch index를 백업받는 방법도 가능하다.
AWS와 거의 유사하지만 config를 수정할 때 하나 더 추가해줘야 하는 부분이 있다.
- elasticsearch.yml에 아래 내용 추가
s3 endpoing를 ncp storage쪽으로 세팅해줘야 한다.
s3.client.default.endpoint: kr.object.ncloudstorage.com
- 백업 폴더 지정 시
당연한거겠지만 access_key와 secret_key는 NCP 기준으로 맞추면 된다.
curl --user '{user}:{password}' --header "content-type: application/JSON" -XPUT 'http://localhost:9200/_snapshot/{snapshot_name}?pretty' -d '{
"type":"s3",
"settings":{
"access_key":"{ncp_access_key}",
"secret_key":"{ncp_secret_key}",
"bucket":"{bucket_name}",
"base_path":"{bucket_path}",
"region":"{region}",
"compress": true
}
}'
- localhost:9200/_snapshot/${name} : name은 스냅샵 이름
- bucket : S3 버킷이름
- base_path : S3 경로
- region : 리전이름
- access_key : NCP 접속 가능한 키
- secret_key : NCP 접속 가능한 키
'Elasticsearch' 카테고리의 다른 글
this action would add [1] total shards, but this cluster currently has [1000]/[1000] maximum shards open (0) | 2023.06.22 |
---|---|
Elasticsearch index restore (부분, 전체 복원 방법) (0) | 2023.05.18 |
Elasticsearch index backup(AWS S3 사용) (0) | 2023.05.16 |