0

I am new to Elastic Search and when I went through the documentation for AWS Elastic Search, I noticed that there is no where, where I can mention the number of shards per index or the number of indexes I require for my cluster in the cloud formation template. Are they using a different terminology for the same?

Abhijith Rao
  • 75
  • 1
  • 1
  • 6

1 Answers1

1

AWS ES is managed by AWS, hence you cannot specify the default sharding strategy on the whole cluster, thus no option/mention of it in CloudFormation.

However, as a workaround for it you can:

  • create index templates which contain an index pattern that matches the nomenclature of your indices. Here you can specify the settings for all indices that match the index pattern.

    PUT _index_template/2p_0r_index_template
    {
      "index_patterns" : ["logstash-*", "filebeat-*", "test-log-index*"],
      "template": {
        "settings" : {
          "number_of_shards" : 2,
          "number_of_replicas": 0
        }
      }
    }
  • specify the sharding strategy (primary and replica shard) whenever creating an index.

    PUT index-000001
    {
      "settings": {
        "number_of_shards": 2,
        "number_of_replicas": 0
      }
    }