# Cluster.routing.allocation.awareness.attributes - definition of "prefer to execute"

**URL:** <https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-definition-of-prefer-to-execute/12879>\
**Category:** Elasticsearch\
**Created:** [July 22, 2013, 12:57pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-definition-of-prefer-to-execute/12879 "2013-07-22T12:57:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Presence](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@Presence](https://discuss.elastic.co/u/Presence)\
**Post date:** [July 22, 2013, 12:57pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-definition-of-prefer-to-execute/12879/1 "2013-07-22T12:57:42Z")

</div>

From the ElasticSearch user guide at  
[http://www.elasticsearch.org/guide/reference/modules/cluster/](http://www.elasticsearch.org/guide/reference/modules/cluster/)...

Automatic Preference When Searching / Getting

When executing a search, or doing a get, the node receiving the request  
will _prefer_ to execute the request on shards that exists on nodes that  
have the same attribute values as the executing node.

What are the conditions that define 'prefer'? Connectivity, load, something  
else? We have data nodes in two physically separate locations with around  
100ms latency between them. It appears that the majority of requests are  
resolved locally but a proportion are suffering from increased latency. Is  
there any way to avoid this. I'd like my 'offsite' replicas to be,  
effectively, hot spares in case of a local failure.

In addition, I'm assuming that the 'prefer' only kicks in when one or more  
cluster.routing.allocation.awareness.attributes are defined, right?

Many thanks in advance.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:25am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-definition-of-prefer-to-execute/12879/2 "2017-07-06T02:25:12Z")

</div>


