ILM and rollover in hot-warm issue

Hello all,
I keep having errors in the rollover and I don't know how to fix them.
I have 2 elastic node and I configure it in HOT-WARM.
The index are automatically created by filebeat - logstash and they are split by day ex. logs_2020-05-22, logs_2020-05-21, etc...

Once index have only 1 shards and its size is approx. 5.5Gb

I would like that all index older than 30 days are moved on warm node and after 90 days the index will be deleted.
I have create this ILM:

`PUT _ilm/policy/hot-warm-90days-delete
`{
` "policy": {
`    "phases": {
`      "hot": {
`        "min_age": "0ms",
`        "actions": {
`          "rollover": {
`           "max_age": "30d"
`         },
`         "set_priority": {
`            "priority": 100
`          }
`        }
`      },
`      "warm": {
`        "min_age": "30d",
`        "actions": {
`          "allocate": {
`           "include": {},
`           "exclude": {},
`           "require": {
`             "box_type": "warm"
`            }
`          },
`          "set_priority": {
`            "priority": 50
`          }
`        }
`      },
`      "delete": {
`       "min_age": "90d",
`       "actions": {
`          "delete": {}
`        }
`      }
`    }
`  }
`}

Now I have multiple issue.
For example, if I not set rollover alias:
`setting [index.lifecycle.rollover_alias] for index [logs_2020-03-30] is empty or not defined

If I set rollover alias:
`index.lifecycle.rollover_alias [hot_warm] does not point to index

I try to set index aliases and set rollover alias in ILM template and index template
I try to set only rollover alias.
I try to set only index aliases.
But every attempt was unsuccessful.

In my last attempt I set only for index logs_2020-03-31 aliases and rollover alias and the rollover complete, the index was moved on warm node.
How I can automate the rollover for all index?

Please could help me :cry:

Welcome! :smiley:

What settings are you applying when you create the index and set it up for rollover?

Hello warkolm,
I create index by logstash config:

output {
  elasticsearch {
    hosts => ["http://10.52.84.163:9200","http://10.52.84.164:9200"]
    index => "logs_%{+YYYY-MM-dd}"
    doc_as_upsert => "true"
    document_id => "%{fingerprint}"
    ilm_enabled => true   
  }
}

In Kibana I create an elasticsearch index template:

PUT _template/ilm_hot_warm
{
  "order": 0,
  "index_patterns": [
    "logs_*"
  ],
  "settings": {
    "index": {
      "lifecycle": {
        "name": "hot-warm-90days-delete"
      },
      "number_of_replicas": "0",
      "refresh_interval": "30s"
    }
  },
  "mappings": {
    "_doc": {
      "_source": {
        "excludes": [],
        "includes": [],
        "enabled": true
      },
      "_meta": {},
      "_routing": {
        "required": false
      },
      "dynamic": true,
      "numeric_detection": false,
      "date_detection": true,
      "dynamic_date_formats": [
        "strict_date_optional_time",
        "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"
      ],
      "dynamic_templates": [],
      "properties": {}
    }
  }
}

The ilm policy "hot-warm-90days-delete" is in first post.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.