# Advanced Configuration

**URL:** <https://discuss.elastic.co/t/advanced-configuration/7316>\
**Category:** Elasticsearch\
**Created:** [April 12, 2012, 8:11pm UTC](https://discuss.elastic.co/t/advanced-configuration/7316 "2012-04-12T20:11:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![newsgroup](https://avatars.discourse-cdn.com/v4/letter/n/ecccb3/32.png) [@newsgroup](https://discuss.elastic.co/u/newsgroup)\
**Post date:** [April 12, 2012, 8:11pm UTC](https://discuss.elastic.co/t/advanced-configuration/7316/1 "2012-04-12T20:11:59Z")

</div>

We are currently running a diverse ES install, with 10+ servers  
running in four different data centres. As such, I would like to  
change the default sharding method to increase the number of replicas,  
as I'd prefer that when a remote DC goes offline for any reason, I  
don't end up with all the replicas for one shard at the end of that  
now dead link.

Ideally, I'd like there to be one copy of each shard in each DC, so  
four shards total, and weighted by server location.

I looked at the ES website but honestly, it's pretty thin on details  
when it comes to configuring the server. Any tips would be  
appreciated, thanks.

---

<div class="post-metadata">

**Author:** ![Dan\_Everton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_everton/32/1865_2.png) [@Dan\_Everton](https://discuss.elastic.co/u/Dan_Everton)\
**Post date:** [April 12, 2012, 11:21pm UTC](https://discuss.elastic.co/t/advanced-configuration/7316/2 "2012-04-12T23:21:57Z")

</div>

It's a bit difficult to find, but you can configure Elasticsearch to be  
"rack aware" when doing shard allocation. See

[http://www.elasticsearch.org/guide/reference/modules/cluster.html](http://www.elasticsearch.org/guide/reference/modules/cluster.html)

for details. ES will even ensure that queries go to the same "rack" for  
performance.

Cheers,  
Dan

---

<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:** [April 13, 2012, 12:34pm UTC](https://discuss.elastic.co/t/advanced-configuration/7316/3 "2012-04-13T12:34:36Z")

</div>

On top of that, it feels like forced allocation makes more sense in this  
case.

On Fri, Apr 13, 2012 at 2:21 AM, Dan Everton [dan@iocaine.org](mailto:dan@iocaine.org) wrote:

> It's a bit difficult to find, but you can configure Elasticsearch to be  
> "rack aware" when doing shard allocation. See
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/cluster.html)
> 
> for details. ES will even ensure that queries go to the same "rack" for  
> performance.
> 
> Cheers,  
> Dan

---

<div class="post-metadata">

**Author:** ![newsgroup](https://avatars.discourse-cdn.com/v4/letter/n/ecccb3/32.png) [@newsgroup](https://discuss.elastic.co/u/newsgroup)\
**Post date:** [April 13, 2012, 3:38pm UTC](https://discuss.elastic.co/t/advanced-configuration/7316/4 "2012-04-13T15:38:11Z")

</div>

On Apr 12, 7:21 pm, Dan Everton [d...@iocaine.org](mailto:d...@iocaine.org) wrote:

> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/cluster.html)

Okay, from that I got the following config:

for my UK DC:

node.zone: uk  
cluster.routing.allocation.awareness.attributes: zone

For my local DC:

node.zone: local  
cluster.routing.allocation.awareness.attributes: zone

So now there's a copy of each shard in each zone, but I'd like _2_  
copies of each shard in each zone. The docs suggest that the  
following option should do this:

cluster.routing.allocation.cluster\_concurrent\_rebalance: 3

But adding it via curl hasn't changed the distribution of shards.

---

<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:** [April 14, 2012, 5:28pm UTC](https://discuss.elastic.co/t/advanced-configuration/7316/5 "2012-04-14T17:28:23Z")

</div>

If you want 2 copies on each zone, then set the index.number\_of\_replicas to  
3 (in addition to the primary, it means you will have 4 copies). I highly  
suggest using forced allocation awareness in this case.

On Fri, Apr 13, 2012 at 6:38 PM, [newsgroup@syslog.com](mailto:newsgroup@syslog.com)  
[newsgroup@syslog.com](mailto:newsgroup@syslog.com)wrote:

> On Apr 12, 7:21 pm, Dan Everton [d...@iocaine.org](mailto:d...@iocaine.org) wrote:
> 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/cluster.html)
> 
> Okay, from that I got the following config:
> 
> for my UK DC:
> 
> node.zone: uk  
> cluster.routing.allocation.awareness.attributes: zone
> 
> For my local DC:
> 
> node.zone: local  
> cluster.routing.allocation.awareness.attributes: zone
> 
> So now there's a copy of each shard in each zone, but I'd like _2_  
> copies of each shard in each zone. The docs suggest that the  
> following option should do this:
> 
> cluster.routing.allocation.cluster\_concurrent\_rebalance: 3
> 
> But adding it via curl hasn't changed the distribution of shards.

---

<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:32am UTC](https://discuss.elastic.co/t/advanced-configuration/7316/6 "2017-07-06T03:32:32Z")

</div>


