Notice
Recent Posts
Recent Comments
Link
«   2025/09   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Tags more
Archives
Today
Total
관리 메뉴

jeongwon

[Elasticsearch] Snapshot -> index 본문

Elastic Stack

[Elasticsearch] Snapshot -> index

jeongwon_ 2023. 4. 10. 17:09

 출처/참고: 엘라스틱서치 실무가이드

 

주제: 다운로드 받은 스냅숏의 인덱스 화

 


스냅숏 생성

논리적 스냅숏  생성

curl -XPUT 'http://localhost:9200/_snapshot/javacafe' -d '{"type": "fs", "settings": {"location": "/home/elastic/practice/book_backup/search_example", "compress": true}}'

 

확인

curl -XGET 'http://localhost:9200/_snapshot/javcafe/_all'

 

결과 (snapshot 명: movie-search, index명: movie_search) 

 

{"snapshots":[{"snapshot":"movie-search","uuid":"Kz5k4fusS7KBZy55wLeZ0Q","version_id":6040399,"version":"6.4.3","indices":["movie_search"],"include_global_state":false,"state":"SUCCESS","start_time":"2019-03-23T16:01:04.910Z","start_time_in_millis":1553356864910,"end_time":"2019-03-23T16:01:05.342Z","end_time_in_millis":1553356865342,"duration_in_millis":432,"failures":[],"shards":{"total":5,"failed":0,"successful":5}}]}

 


논리적 스냅숏 생성2

curl -XPUT 'http://localhost:9200/_snapshot/apache-web-log' -d '{"type":"fs", "settings":{"location":"/home/elastic/practice/book_backup/agg_example", "compress": true}}'

 

확인

curl -XGET 'http://localhost:9200/_snapshot/apache-web-log/_all'

 

결과 (snapshot 명: default, applied-mapping / index 명: apache-web-log,  apache-web-log-applied-mapping)

{"snapshots":[{"snapshot":"default","uuid":"yzmzEx6uSMS55j60z4buBA","version_id":6040399,"version":"6.4.3","indices":["apache-web-log"],"include_global_state":false,"state":"SUCCESS","start_time":"2019-03-23T16:03:50.351Z","start_time_in_millis":1553357030351,"end_time":"2019-03-23T16:03:50.604Z","end_time_in_millis":1553357030604,"duration_in_millis":253,"failures":[],"shards":{"total":5,"failed":0,"successful":5}},{"snapshot":"applied-mapping","uuid":"SgXhqApiSHiauC6fbjSHMw","version_id":6040399,"version":"6.4.3","indices":["apache-web-log-applied-mapping"],"include_global_state":false,"state":"SUCCESS","start_time":"2019-03-23T16:05:46.038Z","start_time_in_millis":1553357146038,"end_time":"2019-03-23T16:05:46.364Z","end_time_in_millis":1553357146364,"duration_in_millis":326,"failures":[],"shards":{"total":5,"failed":0,"successful":5}}]}

 

 


스냅숏의 인덱스화 (kibana Dev Tools)

 

검색

GET /_snapshot/

결과 (javacafe 에는 movie-search, 

{
  "javacafe": {
    "type": "fs",
    "settings": {
      "compress": "true",
      "location": "/home/elastic/practice/book_backup/search_example"
    }
  },
  "apache-web-log": {
    "type": "fs",
    "settings": {
      "compress": "true",
      "location": "/home/elastic/practice/book_backup/agg_example"
    }
  }
}

 

인덱스화

POST /_snapshot/javacafe/movie-search/_restore
POST /_snapshot/apache-web-log/default/_restore
POST /_snapshot/apache-web-log/applied-mapping/_restore

 

각 인덱스 조회

GET movie_search/_search

 

GET apache-web-log/_search

 

 

GET apache-web-log-applied-mapping/_search

'Elastic Stack' 카테고리의 다른 글

[설정] Filebeat => Logstash => ES / 3 node / 20230318  (0) 2023.03.18