# Allocation Awareness with 3 DC

**URL:** <https://discuss.elastic.co/t/allocation-awareness-with-3-dc/196527>\
**Category:** Elasticsearch\
**Created:** [August 23, 2019, 1:00pm UTC](https://discuss.elastic.co/t/allocation-awareness-with-3-dc/196527 "2019-08-23T13:00:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![demudrol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/demudrol/32/24030_2.png) [@demudrol](https://discuss.elastic.co/u/demudrol)\
**Post date:** [August 23, 2019, 1:00pm UTC](https://discuss.elastic.co/t/allocation-awareness-with-3-dc/196527/1 "2019-08-23T13:00:24Z")

</div>

Hi!  
Trying to make cluster.routing.allocation.awareness.force.zone.values with 3 DC.  
On every node make node.attr.zone with DC1 or DC2 or DC3  
and on every master  
cluster.routing.allocation.awareness.attributes: zone  
cluster.routing.allocation.awareness.force.zone.values: DC1,DC2,DC3

And this working but one moment is confusing. Documents now holding only on two nodes (not three).  
Try to move all documents from one node with "cluster.routing.allocation.exclude.\_ip" and expect that clean node will get all that nodes but it's not. There is 3 line on graph (purple, brown and blue). In the middle I apply force.zone.values and after user exclude\_ip

 ![50](https://us1.discourse-cdn.com/elastic/original/3X/3/0/30cf868011b84b1ddde70901e06bcfff72a724f8.png)

For test i have index with 1 replica and 2 shards, so 2 primary shards must allocate in 1 or 2 DC and others 2 shards between 3 DC and 1 or 2.  
Is I doing something wrong? Or force.zone.values can't work with 3 DC?

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [August 30, 2019, 11:31am UTC](https://discuss.elastic.co/t/allocation-awareness-with-3-dc/196527/2 "2019-08-30T11:31:49Z")

</div>

Hi @demudrol,

allocation awareness is primarily a resiliency feature. It balances copies of the same shard (a primary and its replicas) across all your zones, but does not try to otherwise balance shards. It is one amongst several decision factors for where to place or move a shard to. This page has more info on the balancing aspect (which will respect your allocatoin awareness setup, but is otherwise independent of it): [https://www.elastic.co/guide/en/elasticsearch/reference/current/shards-allocation.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/shards-allocation.html).

If you had 1 primary and 2 replicas for an index you should see the 3 copies in different zones. Likewise for 2 primary, 2 replica, you should see a copy of each shard-id in each zone.

---

<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:** [September 27, 2019, 11:31am UTC](https://discuss.elastic.co/t/allocation-awareness-with-3-dc/196527/3 "2019-09-27T11:31:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
