8.2 ๋ฒ์ ์ s3 ๋ฆฌํฌ์งํ ๋ฆฌ ํ๋ฌ๊ทธ์ธ์ด elasticsearch์ ํฌํจ๋์ด์์ด ๋ฐ๋ก ์ค์นํ์ง ์์๋ ๋๋ค.
https://www.elastic.co/guide/en/elasticsearch/plugins/8.2/repository-s3.html
# s3 ํ๋ฌ๊ทธ์ธ์ ์ค์นํ๋ ค๊ณ ํ๋ฉด ๋ค์๊ณผ ๊ฐ์ ๋ฉ์์ง๊ฐ ๋ฌ๋ค ๋ฐ๋ผ์ ๋ฐ๋ก ์ค์นํ์ง ์์๋ ๋๋ค.
elasticsearch@e1f8e9abc280:~/bin$ elasticsearch-plugin installrepository-s3 --batch
-> Installing repository-s3
[repository-s3] is no longer a plugin but instead a module packaged with this distribution of Elasticsearch
-> Please restart Elasticsearch to activate any plugins installed
1. es์ minio ์๊ฒฉ ์ฆ๋ช ์ถ๊ฐํ๊ธฐ
๋ชจ๋ ๋ ธ๋์ minio ์๊ฒฉ ์ฆ๋ช ์ ์ถ๊ฐํ๋ค.
docker exec -it ${์ปจํ
์ด๋ id} /bin/bash
bin/elasticsearch-keystoreadd s3.client.default.access_key
bin/elasticsearch-keystoreadd s3.client.default.secret_key
๋ ธ๋ ๋ค์ ์์ํ๋ค(๋ค์ ์์ํ ๋๋ ์ค๋ ํ ๋น ์ ํ → ๋ค์ ์์ → ์ค๋ ํ ๋น ํ์ฑํ)
2. ์ค๋ ์ท repository ์์ฑ
ํค๋ฐ๋ dev tool ๋๋ curl ๋ช ๋ น์ด๋ก ๋ ๋ฆฐ๋ค.
# _snapshot/๋ ํฌ์งํ ๋ฆฌ์ด๋ฆ
PUT _snapshot/minio-backup
{
"type": "s3",
"settings": {
"bucket": "elasticsearch", # minio์ ๋ฐฑ์
ํ ๋ฒํท ์ด๋ฆ
"endpoint": "XXXX.com:9000", # minio ์ฃผ์
"path_style_access": "true",
"protocol": "https"
}
}
3. ์ค๋ ์ท ์์ฑ
# _snapshot/๋ ํฌ์งํ ๋ฆฌ์ด๋ฆ/์ค๋
์ท์ด๋ฆ
# wait_for_completion๋ ๋๊ธฐ ์์
์ผ๋ก ์คํํด์ฃผ์ด ๋ช
๋ น์ด ๋๋์ง ์๊ณ ๋๊ธฐํ๋๋ก ์ค์ ํด์ฃผ๋ ์ต์
PUT _snapshot/minio-backup/log?wait_for_completion=true
{
"indices": "log*" #์ค๋
์ท๋์์ด๋๋ ์ธ๋ฑ์ค๋ค์ ์ง์ * ์ ์ฉํ์ฌ log๋ก ์์ํ๋ ์ธ๋ฑ์ค๋ฅผ ๋์์ผ๋ก ํ๋ค.
}
4. ์ค๋ ์ท ์์ฑ ํ์ธ
GET _snapshot/minio-backup/log-snap
{
"snapshots" : [
{
"snapshot" : "log-snap", # ์ค๋
์ท ์ด๋ฆ์ ํ์ธํ๋ค.
"uuid" : "JGPoE8HrSLCF8stdUhMCvw",
"repository" : "minio-backup", # ๋ ํฌ์งํ ๋ฆฌ๋ฅผ ํ์ธํ๋ค.
"version_id" : 8020099,
"version" : "8.2.0",
"indices" : [ # ์ค๋
์ท์ผ๋ก ์ ์ฅ๋๋ ์ธ๋ฑ์ค๋ฅผ ํ์ธํ๋ค.
"log-2023.04.02-000367",
"log-2023.04.02-000366",
],
"data_streams" : [ ],
"include_global_state" : true,
"state" : "IN_PROGRESS", # ํ์ฌ ์ค๋
์ท ์ํ๋ฅผ ํ์ธํ๋ค. ์งํ์ค์ด๋ฉด IN_PROGRESS, ์ฑ๊ณตํ์ผ๋ฉด SUCCESS ๊ฐ ๋ฌ๋ค.
"start_time" : "2023-05-31T10:01:38.894Z",
"start_time_in_millis" : 1685527298894,
"end_time" : "1970-01-01T00:00:00.000Z",
"end_time_in_millis" : 0,
"duration_in_millis" : 0,
"failures" : [ ],
"shards" : {
"total" : 146,
"failed" : 125,
"successful" : 21
}
}
],
"total" : 1,
"remaining" : 0
}
'ElasticSearch(OpenSearch)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ES] docker images๋ก elasticsearch ๊ตฌ์ถํ๊ธฐ (0) | 2023.09.10 |
---|---|
[ES] ์ค๋์๊ฐ ํ์ฌ์ด์ฆ์ ๋ฏธ์น๋ ์ํฅ (0) | 2023.09.10 |
[ES] ํ์ฌ์ด์ฆ 32๊ธฐ๊ฐ๋ฅผ ์ต๋๋ก ํด์ผ๋๋ ์ด์ (0) | 2023.09.10 |
[OS] hot-warm๋ ธ๋ ์ฐ๊ฒฐ (0) | 2023.09.10 |
fluentd-kafka-elasticsearch (0) | 2022.05.24 |