# Allocation awareness + force doesn't work on ES 2.4.1

**URL:** <https://discuss.elastic.co/t/allocation-awareness-force-doesnt-work-on-es-2-4-1/66227>\
**Category:** Elasticsearch\
**Created:** [November 16, 2016, 9:30am UTC](https://discuss.elastic.co/t/allocation-awareness-force-doesnt-work-on-es-2-4-1/66227 "2016-11-16T09:30:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![junior\_h](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@junior\_h](https://discuss.elastic.co/u/junior_h)\
**Post date:** [November 16, 2016, 9:30am UTC](https://discuss.elastic.co/t/allocation-awareness-force-doesnt-work-on-es-2-4-1/66227/1 "2016-11-16T09:30:54Z")

</div>

I'm running 15 data nodes of ES 2.4.1. The nodes is grouped by attribute `node.serverno` like bellow

```
es1 -> node.serverno=svr1      
es2 -> node.serverno=svr1     
es3 -> node.serverno=svr1      
es4 -> node.serverno=svr2      
es5 -> node.serverno=svr2      
es6 -> node.serverno=svr2      
es7 -> node.serverno=svr3      
es8 -> node.serverno=svr3      
es9 -> node.serverno=svr3      
es10 -> node.serverno=svr4      
es11 -> node.serverno=svr4      
es12 -> node.serverno=svr4      
es13 -> node.serverno=svr5      
es14 -> node.serverno=svr5      
es15 -> node.serverno=svr5 

```

The cluster has indices of 12 shards + 1 replication. My idea is limiting shards so they only allocated to `node.serverno: svr1/svr2/svr3`. Then, I tried to apply cluster awareness & force:

```
{
  "transient":{
    "cluster.routing.allocation.awareness.attributes": "serverno"
  }
}

{
  "transient":{
    "cluster.routing.allocation.awareness.force.serverno.values": "svr1,svr2,svr3"
  }
}

```

Here what happen:

1. Before apply `*.awareness.*` :  
All shard & replication spread to all nodes

2. After apply `cluster.routing.allocation.awareness.attributes`:  
Replication shards in the node with same `node.serverno` value move to other nodes with different `node.serverno`

3. After apply `cluster.routing.allocation.awareness.force.serverno.values`:  
The state is same as step 2. I expected that all primary + replication shards only spread to nodes with `node.serverno` is svr1 / svr2 / svr3.

I've read [https://www.elastic.co/guide/en/elasticsearch/reference/2.4/allocation-awareness.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/allocation-awareness.html) but might missed understand.

Any advice about that?

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [November 17, 2016, 10:03pm UTC](https://discuss.elastic.co/t/allocation-awareness-force-doesnt-work-on-es-2-4-1/66227/2 "2016-11-17T22:03:17Z")

</div>

Forced awareness is used to make sure that there is no more than one shard copy (either the primary or one of its replicas) per value that you have defined as forced awareness values. It is not used for limiting shard copies to live on nodes with those values only.

What you want to do can be achieved with [shard filtering](https://www.elastic.co/guide/en/elasticsearch/reference/current/shard-allocation-filtering.html).

---

<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:** [December 15, 2016, 10:03pm UTC](https://discuss.elastic.co/t/allocation-awareness-force-doesnt-work-on-es-2-4-1/66227/3 "2016-12-15T22:03:28Z")

</div>

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