# Shard Allocation with multiple includes/excludes

**URL:** <https://discuss.elastic.co/t/shard-allocation-with-multiple-includes-excludes/8411>\
**Category:** Elasticsearch\
**Created:** [July 13, 2012, 7:11pm UTC](https://discuss.elastic.co/t/shard-allocation-with-multiple-includes-excludes/8411 "2012-07-13T19:11:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_2](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@Robert\_2](https://discuss.elastic.co/u/Robert_2)\
**Post date:** [July 13, 2012, 7:11pm UTC](https://discuss.elastic.co/t/shard-allocation-with-multiple-includes-excludes/8411/1 "2012-07-13T19:11:45Z")

</div>

I am trying to setup Shard Allocation using multiple includes, although the  
behavior is not what I would expect. I have read through the docs and  
searched through the group, but I can't seem to figure out what I am doing  
wrong. The following is the setup and some examples of what happened vs  
what I expected when trying to allocate shards. If anyone has any insight  
into this it would be greatly appreciated.

Three nodes set up the following way:

NODE0 -  
node.nodeNum:0  
node.nodeAlpha:A

NODE1 -  
node.nodeNum:1  
node.nodeAlpha:B

NODE2 -  
node.nodeNum:2  
node.nodeAlpha:A

When created my index Initially the shards are split evenly between nodes,  
since I have no allocation setup [Expected]...but then things get strange...

1. I setup the index to include 'nodeNum:1', then all shards go to NODE1  
[Expected]
2. I then add include 'nodeAlpha:A', and the shards split up between NODE0  
& NODE2  
[Expected] - I would expect the shards not to move as we now have include =  
'nodeNum:1' & 'nodeAlpha:A', which would include all nodes
3. If I then change the first include to 'nodeNum:0', the shards don't move  
[Expected] - I would expect the shards all to go to NODE0 as we now have  
include = 'nodeNum:0' & 'nodeAlpha:A', which are both settings for NODE0

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [July 22, 2012, 11:58pm UTC](https://discuss.elastic.co/t/shard-allocation-with-multiple-includes-excludes/8411/2 "2012-07-22T23:58:28Z")

</div>

Robert - this may help -  
[http://blog.sematext.com/2012/05/29/elasticsearch-shard-placement-control/](http://blog.sematext.com/2012/05/29/elasticsearch-shard-placement-control/)

## Otis

Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
Scalable Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

On Friday, July 13, 2012 3:11:45 PM UTC-4, Robert wrote:

> I am trying to setup Shard Allocation using multiple includes, although  
> the behavior is not what I would expect. I have read through the docs and  
> searched through the group, but I can't seem to figure out what I am doing  
> wrong. The following is the setup and some examples of what happened vs  
> what I expected when trying to allocate shards. If anyone has any insight  
> into this it would be greatly appreciated.
> 
> Three nodes set up the following way:
> 
> NODE0 -  
> node.nodeNum:0  
> node.nodeAlpha:A
> 
> NODE1 -  
> node.nodeNum:1  
> node.nodeAlpha:B
> 
> NODE2 -  
> node.nodeNum:2  
> node.nodeAlpha:A
> 
> When created my index Initially the shards are split evenly between nodes,  
> since I have no allocation setup [Expected]...but then things get strange...
> 
> 1. I setup the index to include 'nodeNum:1', then all shards go to NODE1  
> [Expected]
> 2. I then add include 'nodeAlpha:A', and the shards split up between NODE0  
> & NODE2  
> [Expected] - I would expect the shards not to move as we now have include  
> = 'nodeNum:1' & 'nodeAlpha:A', which would include all nodes
> 3. If I then change the first include to 'nodeNum:0', the shards don't move  
> [Expected] - I would expect the shards all to go to NODE0 as we now have  
> include = 'nodeNum:0' & 'nodeAlpha:A', which are both settings for NODE0

---

<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, 3:19am UTC](https://discuss.elastic.co/t/shard-allocation-with-multiple-includes-excludes/8411/3 "2017-07-06T03:19:30Z")

</div>


