🕰️ 작성일 : 2024.03.22

1. OpenSearch 스토리지 구조

Untitled

2. Warm/Cold Storage Manual Migration Test

  1. 테스트용 Index를 하나 생성 및 확인 - Kibana에서도 확인 가능

Untitled

  1. coinone-test’ 인덱스를 Warm으로 이동 및 확인
# Index를 warm으로 이동
POST _ultrawarm/migration/coinone-test/_warm

# Warm Index 조회
GET _warm
  1. Cold Storage로 이동 및 읽기 쿼리 테스트
# Cold Storage로 이동
POST _ultrawarm/migration/coinone-test/_cold?ignore=timestamp

# Cold Storage의 인덱스 확인
GET _cold/indices/_search

# Cold Storage의 인덱스 읽기 시도 -> 읽기 시도 실패(Cold에 있기 때문)
GET coinone-test/_search

Untitled

3. Index State Management를 통한 자동화 - Sample

{
  "policy": {
    "description": "Demonstrate a hot-warm-cold-delete workflow.",
    "default_state": "hot",
    "schema_version": 1,
    "states": [{
        "name": "hot",
        "actions": [],
        "transitions": [{
          "state_name": "warm",
          "conditions": {
            "min_index_age": "10d"
          }
        }]
      },
      {
        "name": "warm",
        "actions": [{
          "warm_migration": {},
          "retry": {
            "count": 5,
            "delay": "1h"
          }
        }],
        "transitions": [{
          "state_name": "cold",
          "conditions": {
            "min_index_age": "90d"
          }
        }]
      },
      {
        "name": "cold",
        "actions": [{
            "cold_migration": {
              "timestamp_field": "<your timestamp field>"
            }
          }
        ],
        "transitions": [{
          "state_name": "delete",
          "conditions": {
             "min_index_age": "365d"
          }
        }]
      },
      {
        "name": "delete",
        "actions": [{
          "notification": {
            "destination": {
              "chime": {
                "url": "<URL>"
              }
            },
            "message_template": {
              "source": "The index {{ctx.index}} is being deleted."
            }
          }
        },
        {
          "cold_delete": {}
        }]
      }
    ]
  }
}