Template priority explanation

Hi all,

I'm trying to change the number_of_replicas of some indexes, applying a loosely index_patterns but... I'm struggling with priority.

If I make a change on number_of_replicas and define a priority 1 on my new template and some other template with priority 3 applies to the same index but lacks the number_of_replicas definition, it will be applied?

So my template:

{
  "priority": 1,
  "index_patterns": [
    "xpto*"
  ],
  "template": {
    "aliases": {},
    "settings": {
      "index": {
        "number_of_replicas": 0
      }
    }
  }
}

The other template

{
  "priority": 3,
  "index_patterns": [
    "xpto*"
  ],
  "template": {
    "aliases": {},
    "mappings": {
      ...
    }
  }
}

If it will not apply the number_of_replicas how can I make it to work without change the highest priority template?

Thank you, Pedro

Priority means that anything that is defined in both settings is only taken from the highest priority.

So if you are not setting the replicas in the higher priority, it will inherit that from the lower priority one.

Thank you @warkolm.

I try:

  1. the replica definition was on the lowest template priority and the mappings on the biggest template priority. No good:
    The mappings definitions were keepted but replicas on the default value (2).

  2. the replica definition was on the biggest template priority and the mappings on the lowest template priority. No good too:
    The mappings definitions were ignored and replicas definition were ok (0).

Can't keep both definitions to be applied despite the change of priorities in the testing.

The final expectation would be: keep the default template (system / kibana) untouched and re-define the replicas value with a biggest priority template "human made" and not loosing or overwrite anything defined in the default template, namely and in the case, the mappings.

Pedro

Hello, nothing more to try?

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