Elasticsearch Opendistro ISM: What approach can be taken to apply the rollover alias and policy to new indices, automatically?

1.4k views Asked by At

When ISM policies are used, the index policy settings need to be applied during index creation but those settings are lost once a new index is created from the rollover action applied by a certain stage/phase in the policy.

For instance, having indices in the form:

pattern:        msp-*          [* => number, in the index template]
alias:          msp-*-alias    [applied during the index creation]
rollover alias: msp-*-alias
policy:         msp-policy-id

Having a template index pattern msp-* (where * is a number) impedes having a rollover alias msp-*-alias for each value that * can take applied automatically. How could this situation be approached?

References:

Can variables be used in elasticsearch index templates?

https://discuss.elastic.co/t/index-lifecycle-management-dynamic-rollover-alias-and-template-name/169614

https://github.com/elastic/elasticsearch/issues/20367

https://github.com/opendistro-for-elasticsearch/index-management/issues/95

https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/ism.html

1

There are 1 answers

0
Sagar Vaghela On

In ISM policy alias does not change after rollover. For example after multiple rollover you will have msp-000001, msp-000002, msp-000003 indices are there. While all indices should point to single static alias like msp-alias. Alias does not change after rollover.

Index setting would be applicable by template while creation of the index through rollover. Below is the example of index template.

PUT _template/msp_template
{
  "index_patterns": "msp-*",
    "settings": {
      "number_of_shards": 2,
      "number_of_replicas": 1,
    "index": {
      "opendistro.index_state_management.rollover_alias": "msp-alias"
    }
  }
}