# ElasticSearch Index / Shard Setting

**URL:** <https://discuss.elastic.co/t/elasticsearch-index-shard-setting/41022>\
**Category:** Elasticsearch\
**Created:** [February 5, 2016, 5:02am UTC](https://discuss.elastic.co/t/elasticsearch-index-shard-setting/41022 "2016-02-05T05:02:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rameeelastic](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rameeelastic](https://discuss.elastic.co/u/rameeelastic)\
**Post date:** [February 5, 2016, 5:02am UTC](https://discuss.elastic.co/t/elasticsearch-index-shard-setting/41022/1 "2016-02-05T05:02:17Z")

</div>

I am trying to create a multi node cluster using 2 machines. below is what i am trying to do.

Master 1 (master=true,data = false)  
data 1 (data=true,master=false)  
data 2 (data=true,master=false)

I want to retain the default shard/replica settings of **_index.number\_of\_shards: 5_** and **index.number\_of\_replicas: 1**. i have 2 Questions,

1. Where should the shard and replica setting be specified in the master node config or data node config?
2. Also if in future if i add more nodes (master/data) w.r.t index/replica anything i need to do ?

Thanks

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 5, 2016, 7:33am UTC](https://discuss.elastic.co/t/elasticsearch-index-shard-setting/41022/2 "2016-02-05T07:33:01Z")

</div>

> [@rameeelastic](#):
>
> Master 1 (master=true,data = false)data 1 (data=true,master=false)data 2 (data=true,master=false)

You ideally want to have 3 master eligible nodes in the cluster, so I would recommend making all 3 nodes master eligible. Running with a single dedicated master node makes it a single point of failure. Once you have 3 master eligible nodes, you need to set minimum\_master\_nodes to 2 (instead of the default 1) in order to prevent split brain scenarios.

> [@rameeelastic](#):
>
> 1. Where should the shard and replica setting be specified in the master node config or data node config?

Those are the default settings, so no need to specify tin the config. If you change it, do it on all nodes.

> [@rameeelastic](#):
>
> 1. Also if in future if i add more nodes (master/data) w.r.t index/replica anything i need to do ?

Even for larger clusters you can keep 3 nodes master eligible, which means that you do not need to update any settings. If you however increase the number of master eligible nodes, you must update 'minimum\_master\_nodes' to be (Number of master eligible nodes/2)+1 (a majority of your master eligible nodes).

---

<div class="post-metadata">

**Author:** ![rameeelastic](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rameeelastic](https://discuss.elastic.co/u/rameeelastic)\
**Post date:** [February 5, 2016, 7:51am UTC](https://discuss.elastic.co/t/elasticsearch-index-shard-setting/41022/3 "2016-02-05T07:51:15Z")

</div>

Thanks !!!  
makes sense. I will test this out.

---

<div class="post-metadata">

**Author:** ![rameeelastic](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rameeelastic](https://discuss.elastic.co/u/rameeelastic)\
**Post date:** [February 5, 2016, 10:43am UTC](https://discuss.elastic.co/t/elasticsearch-index-shard-setting/41022/4 "2016-02-05T10:43:12Z")

</div>

Thanks the nodes are setup and able to communicate with each other. I am able to send data to one of the datanode through logstash.

I will try out couple of things I have in mind and will create a separate topic if I have doubts.

---

<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:** [July 5, 2017, 11:18pm UTC](https://discuss.elastic.co/t/elasticsearch-index-shard-setting/41022/5 "2017-07-05T23:18:37Z")

</div>


