개발 서버 로그 Index에 Geo-IP를 추가해볼려고 여러 설정을 추가하다가 Index에 Error가 발생해서 현재 쌓이고 있던 Index를 삭제를 진행 했다.
그러자 인덱스 자동 생성이 안되고, 로그 수집이 중단되는 현상이 있어서 인덱스를 살리는 방법에 대해 알아 봤다.
// command
POST {index aliases}/_rollover
// ex)
POST service-dev-log/_rollover
{
"acknowledged": true,
"shards_acknowledged": true,
"old_index": "service-dev-log-2023.05.07-000033",
"new_index": "service-dev-log-2023.05.07-000034",
"rolled_over": true,
"dry_run": false,
"conditions": {}
}
v=true
옵션을 줘서 컬럼의 헤더 값을 출력함s=index
옵션을 줘서 index 필드로 Sorting 해서 출력함// command
GET /_cat/aliases/{index aliases}
// ex)
GET /_cat/aliases/service-dev-log?v=true&s=index
alias index filter routing.index routing.search is_write_index
service-dev-log service-dev-log-2023.04.26-000005 - - - false
service-dev-log service-dev-log-2023.04.28-000006 - - - false
service-dev-log service-dev-log-2023.05.01-000007 - - - false
service-dev-log service-dev-log-2023.05.03-000008 - - - false
service-dev-log service-dev-log-2023.05.04-000009 - - - false
service-dev-log service-dev-log-2023.05.05-000010 - - - false
service-dev-log service-dev-log-2023.05.06-000011 - - - false
service-dev-log service-dev-log-2023.05.07-000014 - - - false
service-dev-log service-dev-log-2023.05.07-000015 - - - false
service-dev-log service-dev-log-2023.05.07-000016 - - - false
service-dev-log service-dev-log-2023.05.07-000017 - - - false
service-dev-log service-dev-log-2023.05.07-000018 - - - false
service-dev-log service-dev-log-2023.05.07-000019 - - - false
service-dev-log service-dev-log-2023.05.07-000020 - - - false
service-dev-log service-dev-log-2023.05.07-000021 - - - false
service-dev-log service-dev-log-2023.05.07-000022 - - - false
service-dev-log service-dev-log-2023.05.07-000023 - - - false
service-dev-log service-dev-log-2023.05.07-000024 - - - false
service-dev-log service-dev-log-2023.05.07-000025 - - - false
service-dev-log service-dev-log-2023.05.07-000026 - - - false
service-dev-log service-dev-log-2023.05.07-000027 - - - false
service-dev-log service-dev-log-2023.05.07-000028 - - - false
service-dev-log service-dev-log-2023.05.07-000029 - - - false
service-dev-log service-dev-log-2023.05.07-000030 - - - false
service-dev-log service-dev-log-2023.05.07-000031 - - - false
service-dev-log service-dev-log-2023.05.07-000032 - - - false
service-dev-log service-dev-log-2023.05.07-000033 - - - false
service-dev-log service-dev-log-2023.05.07-000034 - - - true
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html