# TotalShardsPerNode Index setting VS cluster setting

**URL:** <https://discuss.elastic.co/t/totalshardspernode-index-setting-vs-cluster-setting/76643>\
**Category:** Elasticsearch\
**Created:** [February 27, 2017, 3:15pm UTC](https://discuss.elastic.co/t/totalshardspernode-index-setting-vs-cluster-setting/76643 "2017-02-27T15:15:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonathanAaron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonathanaaron/32/24405_2.png) [@JonathanAaron](https://discuss.elastic.co/u/JonathanAaron)\
**Post date:** [February 27, 2017, 3:15pm UTC](https://discuss.elastic.co/t/totalshardspernode-index-setting-vs-cluster-setting/76643/1 "2017-02-27T15:15:24Z")

</div>

Settings in question:  
**cluster.routing.allocation.total\_shards\_per\_node**  
**index.routing.allocation.total\_shards\_per\_node**

Actual Question:  
Lets say I have multiple indices and I set **index.routing.allocation.total\_shards\_per\_node** to **5**.  
Does that block other indices from having shards on the node?

Scenario:  
**Index A** has index.routing.allocation.total\_shards\_per\_node: 5  
**Index B** has index.routing.allocation.total\_shards\_per\_node: 5

If **Node 1** has **5 shards** from **index A** on it can it accept any from **index B**?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 27, 2017, 3:50pm UTC](https://discuss.elastic.co/t/totalshardspernode-index-setting-vs-cluster-setting/76643/2 "2017-02-27T15:50:59Z")

</div>

Hey,

should work, but this is one of the classic examples, where quick testing beats guessing.  
You can easily test this, using the following snippet and tweaking the values

```auto
DELETE _all

PUT _cluster/settings
{
  "transient": {
    "cluster.routing.allocation.total_shards_per_node" : 1
  }
}

PUT a
{
  "settings": {
    "index.routing.allocation.total_shards_per_node" : 1,
    "number_of_shards": 2
  }
}

PUT b
{
  "settings": {
    "index.routing.allocation.total_shards_per_node" : 1,
    "number_of_shards": 2
  }
}

# this will show if the shards have been assigned or not
GET _cat/shards

```

hope this helps

--Alex

---

<div class="post-metadata">

**Author:** ![JonathanAaron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonathanaaron/32/24405_2.png) [@JonathanAaron](https://discuss.elastic.co/u/JonathanAaron)\
**Post date:** [February 27, 2017, 4:03pm UTC](https://discuss.elastic.co/t/totalshardspernode-index-setting-vs-cluster-setting/76643/3 "2017-02-27T16:03:03Z")

</div>

Cool I'll test it out. Thanks

---

<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:** [March 27, 2017, 4:03pm UTC](https://discuss.elastic.co/t/totalshardspernode-index-setting-vs-cluster-setting/76643/4 "2017-03-27T16:03:13Z")

</div>

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