Index template not updated

#1

HI all,

I have an index template which is defined to use only a single shard.

GET _template/plx

{
  "plx" : {
    "order" : 0,
    "index_patterns" : [
      "plx*"
    ],
    "settings" : {
      "index" : {
        "number_of_shards" : "1",
        "number_of_replicas" : "0"
      }
    },
    "mappings" : { },
    "aliases" : { }
  }
}

I want to increase the number of Shards to 2. As I understand when changing the template it will only affect new indexes, so when the index is rotated next time and a new one is created, correct? Currently I am rotating once a week via logstash index pattern. (I may change to rollover when I checked this feature out).

So I am now sending the following:

POST template/plx
{
 
    "index_patterns" : [
      "plx*"
    ],
    "settings" : {
      "index" : {
        "number_of_shards" : "2",
        "number_of_replicas" : "0"
      }
    },
    "mappings" : { },
    "aliases" : { }
  
}

getting following response:

{
  "_index" : "template",
  "_type" : "plx",
  "_id" : "byQBwWoBWG0LH47pl1tp",
  "_version" : 1,
  "result" : "created",
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "_seq_no" : 4,
  "_primary_term" : 1
}

But when I query the template again, I still shows the same as initial: 1 shard.

Can you point to my mistake?

Using elasticsearch 6.6.2.

Elasticsearch log is showing:

[2019-05-16T14:12:42,365][INFO ][o.e.c.m.MetaDataMappingService] [0] [template/cYj_zxK0TPKGyAW5fzqC_A] update_mapping [plx]

Thanks a lot, Andreas

(George) #2

There should be an _ in your POST when you create the template. i.e. POST _template/plx instead of POST template/plx. At the moment, you're creating a document in a new index called template.

#3

@whatgeorgemade

Thanks a lot. That's it :wink: