# Number of Shards in Master-Worker topology

**URL:** <https://discuss.elastic.co/t/number-of-shards-in-master-worker-topology/24940>\
**Category:** Elasticsearch\
**Created:** [July 6, 2015, 10:21am UTC](https://discuss.elastic.co/t/number-of-shards-in-master-worker-topology/24940 "2015-07-06T10:21:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shovik](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@shovik](https://discuss.elastic.co/u/shovik)\
**Post date:** [July 6, 2015, 10:21am UTC](https://discuss.elastic.co/t/number-of-shards-in-master-worker-topology/24940/1 "2015-07-06T10:21:42Z")

</div>

Hi,

I was playing around with the Elastic Topology and created a topology where the master node had different number of shards than that configured in the worker node configs.

eg. Master config - index.number\_of\_shards:10  
Worker2 config - index.number\_of\_shards:8  
Worker2 config - index.number\_of\_shards:12

Can anyone explain what is the relationship between the number of shards mentioned in master and that of the workers.

What I noticed is that, the cluster is always taking the number of shards mentioned in the master, no matter what numbers are mentioned in the worker.

Does is mean that I can't have different number of shards in different nodes depending upon my requirement ?  
Meaning, if I know that for a particular Node the data (index in that node) is such that creating more shards and routing queries would be more helpful but for another node I want only less, say, only 1 shard.

Any insights would be of great help.

Thanks  
Shovik

---

<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:** [July 6, 2015, 10:35am UTC](https://discuss.elastic.co/t/number-of-shards-in-master-worker-topology/24940/2 "2015-07-06T10:35:03Z")

</div>

This setting defines the default number of shards to use when a new index is created. It does not affect the distribution or allocation of shards across the nodes, so it makes no sense to set if to different values of different nodes.

---

<div class="post-metadata">

**Author:** ![mosiddi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mosiddi/32/577_2.png) [@mosiddi](https://discuss.elastic.co/u/mosiddi)\
**Post date:** [July 6, 2015, 3:39pm UTC](https://discuss.elastic.co/t/number-of-shards-in-master-worker-topology/24940/3 "2015-07-06T15:39:31Z")

</div>

Like Christian said this is the setting to be used while creating a new index. ES by default does distribution of shards to nodes. In your scenario u can think of multiple indices and use include/exclude tags to put specific indices in specific nodes.

---

<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 6, 2017, 12:03am UTC](https://discuss.elastic.co/t/number-of-shards-in-master-worker-topology/24940/4 "2017-07-06T00:03:25Z")

</div>


