# Is spaced considered when allocating shards?

**URL:** <https://discuss.elastic.co/t/is-spaced-considered-when-allocating-shards/4487>\
**Category:** Elasticsearch\
**Created:** [May 27, 2011, 12:16am UTC](https://discuss.elastic.co/t/is-spaced-considered-when-allocating-shards/4487 "2011-05-27T00:16:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![byuva](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@byuva](https://discuss.elastic.co/u/byuva)\
**Post date:** [May 27, 2011, 12:16am UTC](https://discuss.elastic.co/t/is-spaced-considered-when-allocating-shards/4487/1 "2011-05-27T00:16:46Z")

</div>

Let's say I have several machines in my cluster with varying amounts  
of free storage and one node goes offline. Will ES move the replicas  
to the machine with the greatest amount of free storage? What happens  
if by moving the shards a machine will run out of storage space? I  
assume it will not move the shard (which could very well bring down  
another node causing a cascading failure).

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 27, 2011, 8:14am UTC](https://discuss.elastic.co/t/is-spaced-considered-when-allocating-shards/4487/2 "2011-05-27T08:14:39Z")

</div>

There is no consideration for space (currently), just to get to a state where an even number of shards exists on each node.

On Friday, May 27, 2011 at 3:16 AM, merrellb wrote:

> Let's say I have several machines in my cluster with varying amounts  
> of free storage and one node goes offline. Will ES move the replicas  
> to the machine with the greatest amount of free storage? What happens  
> if by moving the shards a machine will run out of storage space? I  
> assume it will not move the shard (which could very well bring down  
> another node causing a cascading failure).

---

<div class="post-metadata">

**Author:** ![byuva](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@byuva](https://discuss.elastic.co/u/byuva)\
**Post date:** [May 27, 2011, 8:36pm UTC](https://discuss.elastic.co/t/is-spaced-considered-when-allocating-shards/4487/3 "2011-05-27T20:36:07Z")

</div>

So does this mean it will move a node to satisfy the requested # of  
replicas even if there is not enough space on the node? I could see  
this potentially leading to cascading failure as more nodes become  
full, are taken off-line and require more shards to be reallocated,  
filling more nodes.

On May 27, 4:14 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> There is no consideration for space (currently), just to get to a state where an even number of shards exists on each node.
> 
> On Friday, May 27, 2011 at 3:16 AM, merrellb wrote:
> 
> > Let's say I have several machines in my cluster with varying amounts  
> > of free storage and one node goes offline. Will ES move the replicas  
> > to the machine with the greatest amount of free storage? What happens  
> > if by moving the shards a machine will run out of storage space? I  
> > assume it will not move the shard (which could very well bring down  
> > another node causing a cascading failure).

---

<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, 4:05am UTC](https://discuss.elastic.co/t/is-spaced-considered-when-allocating-shards/4487/4 "2017-07-06T04:05:10Z")

</div>


