# How to modify default total\_indices count of 20 to desired count and set replication for each index

**URL:** <https://discuss.elastic.co/t/how-to-modify-default-total-indices-count-of-20-to-desired-count-and-set-replication-for-each-index/77447>\
**Category:** Elasticsearch\
**Created:** [March 6, 2017, 6:38am UTC](https://discuss.elastic.co/t/how-to-modify-default-total-indices-count-of-20-to-desired-count-and-set-replication-for-each-index/77447 "2017-03-06T06:38:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarank](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sarank](https://discuss.elastic.co/u/sarank)\
**Post date:** [March 6, 2017, 6:38am UTC](https://discuss.elastic.co/t/how-to-modify-default-total-indices-count-of-20-to-desired-count-and-set-replication-for-each-index/77447/1 "2017-03-06T06:38:14Z")

</div>

Hello,

Here I am trying to set elastic-search (Version 2.4) cluster with Graylog2 ( Version 2.2). I brought up two master nodes (for fail-over purpose), two data nodes and two client nodes ( graylog server itself ). Have attached single line diagram below,

![](https://us1.discourse-cdn.com/elastic/original/3X/a/a/aa142f873924b19f6665bc112821cdce3fd8403c.png)

My problem here is, I want to keep a maximum of 200 indices with replicas. From some resource I found the below CURL command to create replicas

```
curl -XPUT 'http://localhost:9200/graylog2_*/_settings' -d '
{
    "index" : {
        "number_of_replicas" : 1
    }
}'

```

but i have to run this every time, when a new index gets created. I also tried adding `index.number_of_replicas: 1` but Elasticsearch never starts if I add this property to my `elasticsearch.yml` file.

Secondly,

I have also added `elasticsearch_max_number_of_indices = 200` in my elasticsearch.yml file. This time my elasticsearch starts, but whenever i check my indices count its always 20. Have attached my ES configuration file below, please correct me if I am wrong. Will be grateful for any help on this, thanks in advance.

> Elasticsearch Master Config:

```
 cluster.name: graylog2

 node.name: graylog-master-1
 node.master: true
 node.data: false
 node.client: false
 path.data: /graylog2
 bootstrap.memory_lock: true
 network.host: localhost
 network.bind.host: 0.0.0.0
 http.port: 9200
discovery.zen.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["master1_IP", "master2_IP"]
 discovery.zen.minimum_master_nodes: 1
 elasticsearch_max_number_of_indices: 200

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 3, 2017, 6:38am UTC](https://discuss.elastic.co/t/how-to-modify-default-total-indices-count-of-20-to-desired-count-and-set-replication-for-each-index/77447/2 "2017-04-03T06:38:33Z")

</div>

Closed on April 3, 2017, 6:38am UTC

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