# How work rackIDs in ElasticSearch

**URL:** <https://discuss.elastic.co/t/how-work-rackids-in-elasticsearch/9690>\
**Category:** Elasticsearch\
**Created:** [November 13, 2012, 7:34am UTC](https://discuss.elastic.co/t/how-work-rackids-in-elasticsearch/9690 "2012-11-13T07:34:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Rennecke](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_Rennecke](https://discuss.elastic.co/u/Michael_Rennecke)\
**Post date:** [November 13, 2012, 7:34am UTC](https://discuss.elastic.co/t/how-work-rackids-in-elasticsearch/9690/1 "2012-11-13T07:34:40Z")

</div>

Hello,

work the 'node.rack' config parameter, like the rackID by Hadoop?

For example: I have 3 replicas, some indizes and 4 rackIDs. Places  
ElasticSearch a 'complete' index in every rack?

regards,  
michael

--

- Michael Rennecke \*  
Junior Systemarchitekt, Semantic Web Project, IT

Unister Holding GmbH  
Barfußgässchen 11 | 04109 Leipzig

Telefon: +49 (0)341 355381 25291  
[michael.rennecke@unister-gmbh.de](mailto:michael.rennecke@unister-gmbh.de) [mailto:michael.rennecke@unister-gmbh.de](mailto:michael.rennecke@unister-gmbh.de)  
[www.unister.de](http://www.unister.de) [http://www.unister.de/](http://www.unister.de/)

Vertretungsberechtigter Geschäftsführer: Thomas Wagner  
Amtsgericht Leipzig, HRB: 25007

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [November 13, 2012, 9:01am UTC](https://discuss.elastic.co/t/how-work-rackids-in-elasticsearch/9690/2 "2012-11-13T09:01:40Z")

</div>

Hello Michael,

Yes, the idea is to have complete sets of data deployed on nodes  
having the same attribute. The attribute can have any name, like  
"rack", "rack\_id", "datacenter\_name", etc.

Just setting the attribute won't do anything - you need to specify  
what you want to do with that attribute. And there are two typical  
scenarios:

- you want to _avoid_ having shards and replicas on a single group of  
nodes. For that, you can configure  
"cluster.routing.allocation.awareness.attributes:  
attribute\_name\_goes\_here". Then, ES will try to allocate a complete  
set of data to nodes having one value of the attribute (say, "rack\_id:  
one"), another set of data (replicas) to nodes having another value  
(say, "rack\_id: two") and so on
- you want to _make sure_ shards and replicas don't end up on a single  
group of nodes. For example, you have 5 nodes in a rack and 5 nodes in  
another rack. And you have one index with 5 shards and a replica. With  
the configuration above you'd end up with a complete set of shards per  
rack. But if a whole rack goes down, ES will reallocate the replicas  
to the available nodes - so you'll have all 10 shards (5 primary + 5  
replicas) on your remaining 5 nodes. But if you add  
"cluster.routing.allocation.awareness.force.zone.values: one,two", if  
a rack goes down replicas shouldn't get allocated to the remaining  
rack.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Tue, Nov 13, 2012 at 9:34 AM, Michael Rennecke  
[michael.rennecke@unister-gmbh.de](mailto:michael.rennecke@unister-gmbh.de) wrote:

> Hello,
> 
> work the 'node.rack' config parameter, like the rackID by Hadoop?
> 
> For example: I have 3 replicas, some indizes and 4 rackIDs. Places  
> Elasticsearch a 'complete' index in every rack?
> 
> regards,  
> michael

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [November 13, 2012, 9:03am UTC](https://discuss.elastic.co/t/how-work-rackids-in-elasticsearch/9690/3 "2012-11-13T09:03:25Z")

</div>

On Tue, Nov 13, 2012 at 11:01 AM, Radu Gheorghe  
[radu.gheorghe@sematext.com](mailto:radu.gheorghe@sematext.com) wrote:

> Hello Michael,
> 
> Yes, the idea is to have complete sets of data deployed on nodes  
> having the same attribute. The attribute can have any name, like  
> "rack", "rack\_id", "datacenter\_name", etc.
> 
> Just setting the attribute won't do anything - you need to specify  
> what you want to do with that attribute. And there are two typical  
> scenarios:
> 
> - you want to _avoid_ having shards and replicas on a single group of  
> nodes. For that, you can configure  
> "cluster.routing.allocation.awareness.attributes:  
> attribute\_name\_goes\_here". Then, ES will try to allocate a complete  
> set of data to nodes having one value of the attribute (say, "rack\_id:  
> one"), another set of data (replicas) to nodes having another value  
> (say, "rack\_id: two") and so on
> - you want to _make sure_ shards and replicas don't end up on a single  
> group of nodes. For example, you have 5 nodes in a rack and 5 nodes in  
> another rack. And you have one index with 5 shards and a replica. With  
> the configuration above you'd end up with a complete set of shards per  
> rack. But if a whole rack goes down, ES will reallocate the replicas  
> to the available nodes - so you'll have all 10 shards (5 primary + 5  
> replicas) on your remaining 5 nodes. But if you add  
> "cluster.routing.allocation.awareness.force.zone.values: one,two"

copy-paste error :(. If your attribute name is "rack\_id", then the  
config would be:

cluster.routing.allocation.awareness.force.rack\_id.values: one,two

> , if  
> a rack goes down replicas shouldn't get allocated to the remaining  
> rack.
> 
> ## Best regards, Radu
> 
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> On Tue, Nov 13, 2012 at 9:34 AM, Michael Rennecke  
> [michael.rennecke@unister-gmbh.de](mailto:michael.rennecke@unister-gmbh.de) wrote:
> 
> > Hello,
> > 
> > work the 'node.rack' config parameter, like the rackID by Hadoop?
> > 
> > For example: I have 3 replicas, some indizes and 4 rackIDs. Places  
> > Elasticsearch a 'complete' index in every rack?
> > 
> > regards,  
> > michael

--

---

<div class="post-metadata">

**Author:** ![Michael\_Rennecke](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_Rennecke](https://discuss.elastic.co/u/Michael_Rennecke)\
**Post date:** [November 13, 2012, 11:51am UTC](https://discuss.elastic.co/t/how-work-rackids-in-elasticsearch/9690/4 "2012-11-13T11:51:19Z")

</div>

Hallo,

thx Radu,

kind regards,  
michael

Am 13.11.2012 10:03, schrieb Radu Gheorghe:

> On Tue, Nov 13, 2012 at 11:01 AM, Radu Gheorghe  
> [radu.gheorghe@sematext.com](mailto:radu.gheorghe@sematext.com) wrote:
> 
> > Hello Michael,
> > 
> > Yes, the idea is to have complete sets of data deployed on nodes  
> > having the same attribute. The attribute can have any name, like  
> > "rack", "rack\_id", "datacenter\_name", etc.
> > 
> > Just setting the attribute won't do anything - you need to specify  
> > what you want to do with that attribute. And there are two typical  
> > scenarios:
> > 
> > - you want to _avoid_ having shards and replicas on a single group of  
> > nodes. For that, you can configure  
> > "cluster.routing.allocation.awareness.attributes:  
> > attribute\_name\_goes\_here". Then, ES will try to allocate a complete  
> > set of data to nodes having one value of the attribute (say, "rack\_id:  
> > one"), another set of data (replicas) to nodes having another value  
> > (say, "rack\_id: two") and so on
> > - you want to _make sure_ shards and replicas don't end up on a single  
> > group of nodes. For example, you have 5 nodes in a rack and 5 nodes in  
> > another rack. And you have one index with 5 shards and a replica. With  
> > the configuration above you'd end up with a complete set of shards per  
> > rack. But if a whole rack goes down, ES will reallocate the replicas  
> > to the available nodes - so you'll have all 10 shards (5 primary + 5  
> > replicas) on your remaining 5 nodes. But if you add  
> > "cluster.routing.allocation.awareness.force.zone.values: one,two"
> 
> copy-paste error :(. If your attribute name is "rack\_id", then the  
> config would be:
> 
> cluster.routing.allocation.awareness.force.rack\_id.values: one,two
> 
> > , if  
> > a rack goes down replicas shouldn't get allocated to the remaining  
> > rack.
> > 
> > ## Best regards, Radu
> > 
> > [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> > 
> > On Tue, Nov 13, 2012 at 9:34 AM, Michael Rennecke  
> > [michael.rennecke@unister-gmbh.de](mailto:michael.rennecke@unister-gmbh.de) wrote:
> > 
> > > Hello,
> > > 
> > > work the 'node.rack' config parameter, like the rackID by Hadoop?
> > > 
> > > For example: I have 3 replicas, some indizes and 4 rackIDs. Places  
> > > Elasticsearch a 'complete' index in every rack?
> > > 
> > > regards,  
> > > michael

--

- Michael Rennecke \*  
Junior Systemarchitekt, Semantic Web Project, IT

Unister Holding GmbH  
Barfußgässchen 11 | 04109 Leipzig

Telefon: +49 (0)341 355381 25291  
[michael.rennecke@unister-gmbh.de](mailto:michael.rennecke@unister-gmbh.de) [mailto:michael.rennecke@unister-gmbh.de](mailto:michael.rennecke@unister-gmbh.de)  
[www.unister.de](http://www.unister.de) [http://www.unister.de/](http://www.unister.de/)

Vertretungsberechtigter Geschäftsführer: Thomas Wagner  
Amtsgericht Leipzig, HRB: 25007

--

---

<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:04am UTC](https://discuss.elastic.co/t/how-work-rackids-in-elasticsearch/9690/5 "2017-07-06T03:04:35Z")

</div>


