# Default shard allocation (where new shards are created)

**URL:** <https://discuss.elastic.co/t/default-shard-allocation-where-new-shards-are-created/21327>\
**Category:** Elasticsearch\
**Created:** [December 19, 2014, 8:36am UTC](https://discuss.elastic.co/t/default-shard-allocation-where-new-shards-are-created/21327 "2014-12-19T08:36:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin\_Clarke](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Robin\_Clarke](https://discuss.elastic.co/u/Robin_Clarke)\
**Post date:** [December 19, 2014, 8:36am UTC](https://discuss.elastic.co/t/default-shard-allocation-where-new-shards-are-created/21327/1 "2014-12-19T08:36:43Z")

</div>

My current setup is with 10 nodes with ample space on spinning disks, and  
20 nodes with smaller SSD disks.  
I would like my workflow to be that all data is initially indexed on the  
SSD nodes, after 10 days is reallocated to the spinning disks, after a  
further 10 days the index is closed, and after a further 70 days the  
indexes are deleted.  
The curator is great for moving them to the spinning disks, but what I am  
not sure about is how to define that initially all shards (primary and  
replica) of an index should be created on the ssd nodes.  
The spinning disk nodes are tagged:  
node.disk\_type: spinning  
The ssd nodes are tagged  
node.disk\_type: ssd

To transfer after 10 days to spinning:  
/usr/local/bin/curator --host es101 allocation --older-than 9 --rule  
disk\_type=spinning

But how do I define that the default location for all new shards should be  
on disk\_type:ssd ?

I have the example here  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-cluster.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-cluster.html) which  
I think could be modified like this:

curl -XPUT localhost:9200/\_cluster/settings -d '{  
"persistent" : {  
"cluster.routing.allocation.require.disk\_type" : "ssd"  
}  
}'

But for one this setting does not exist, and I'm not sure if this will stop  
the shards being reallocated to spinning later on...

Any ideas how to implement my desired workflow?

Thank you!  
-Robin-

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/18615b7c-8e99-42ee-b54d-ef06a1888181%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/18615b7c-8e99-42ee-b54d-ef06a1888181%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [December 19, 2014, 2:04pm UTC](https://discuss.elastic.co/t/default-shard-allocation-where-new-shards-are-created/21327/2 "2014-12-19T14:04:48Z")

</div>

Check what curator is doing with your index. Its probably fiddling with  
index.routing.allocation.include and index.routing.allocation.exclude.  
When you create the new index just set it pick up the ssd tag. You'll have  
to make sure that curator knows how to strip that tag when the time comes  
to move it to the spinning disks.

Nik

On Fri, Dec 19, 2014 at 3:36 AM, Robin Clarke [robin13@gmail.com](mailto:robin13@gmail.com) wrote:

> My current setup is with 10 nodes with ample space on spinning disks, and  
> 20 nodes with smaller SSD disks.  
> I would like my workflow to be that all data is initially indexed on the  
> SSD nodes, after 10 days is reallocated to the spinning disks, after a  
> further 10 days the index is closed, and after a further 70 days the  
> indexes are deleted.  
> The curator is great for moving them to the spinning disks, but what I am  
> not sure about is how to define that initially all shards (primary and  
> replica) of an index should be created on the ssd nodes.  
> The spinning disk nodes are tagged:  
> node.disk\_type: spinning  
> The ssd nodes are tagged  
> node.disk\_type: ssd
> 
> To transfer after 10 days to spinning:  
> /usr/local/bin/curator --host es101 allocation --older-than 9 --rule  
> disk\_type=spinning
> 
> But how do I define that the default location for all new shards should be  
> on disk\_type:ssd ?
> 
> I have the example here  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-cluster.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-cluster.html) which  
> I think could be modified like this:
> 
> curl -XPUT localhost:9200/\_cluster/settings -d '{  
> "persistent" : {  
> "cluster.routing.allocation.require.disk\_type" : "ssd"  
> }  
> }'
> 
> But for one this setting does not exist, and I'm not sure if this will  
> stop the shards being reallocated to spinning later on...
> 
> Any ideas how to implement my desired workflow?
> 
> Thank you!  
> -Robin-
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/18615b7c-8e99-42ee-b54d-ef06a1888181%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/18615b7c-8e99-42ee-b54d-ef06a1888181%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/18615b7c-8e99-42ee-b54d-ef06a1888181%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/18615b7c-8e99-42ee-b54d-ef06a1888181%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0sjd\_VEY1sC\_e5dswtBFT51M6wdsa1y%3D8kDx0zKMad6Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0sjd_VEY1sC_e5dswtBFT51M6wdsa1y%3D8kDx0zKMad6Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:42am UTC](https://discuss.elastic.co/t/default-shard-allocation-where-new-shards-are-created/21327/3 "2017-07-06T00:42:42Z")

</div>


