# Cluster.routing.allocation.awareness cause shards unassigned

**URL:** <https://discuss.elastic.co/t/cluster-routing-allocation-awareness-cause-shards-unassigned/75811>\
**Category:** Elasticsearch\
**Created:** [February 21, 2017, 3:46am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-cause-shards-unassigned/75811 "2017-02-21T03:46:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayqie](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jayqie](https://discuss.elastic.co/u/jayqie)\
**Post date:** [February 21, 2017, 3:46am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-cause-shards-unassigned/75811/1 "2017-02-21T03:46:14Z")

</div>

I split one elasticsearch cluster into two groups for different scenario usage. One is for high-frequency calls, and the other is normal. The two groups are isolated to prevent the normal group from being affected. I split the cluster using following steps:

1. Create a elasticsearch cluster with four datanodes, two are high-frequency calls, and two are normal.  
data-1: node.attr.cluster: highfreq  
data-2: node.attr.cluster: normalfreq  
data-3: node.attr.cluster: highfreq  
data-4: node.attr.cluster: normalfreq

2. Create a new index, routing to two groups  
PUT /ztest  
{  
"settings": {  
"number\_of\_shards": 3,  
"number\_of\_replicas": 1,  
"index.routing.allocation.include.cluster": "highfreq,normalfreq"  
}  
}

3. Make sure that each group has a complete copy of shards.  
PUT /\_cluster/settings  
{  
"persistent" : {  
"cluster.routing.allocation.awareness.attributes" : "cluster"  
}  
}

4. Specify the group when querying  
GET /ztest/\_search?preference=cluster:highfreq  
GET /ztest/\_search?preference=cluster:normal

It seems to work properly:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/95e33443fb8ab0abf94ca92959655440186c47b1.png)

1. But sometimes I want to allocate the index only in normal group(this often occurs in some scenarios):

PUT /ztest  
{  
"settings": {  
"number\_of\_shards": 3,  
"number\_of\_replicas": 1,  
"index.routing.allocation.include.cluster": "normalfreq"  
}  
}

Then only primary shards can be allocated, and the replication shards are unassigned, although there is still a spare resource of one data-node:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/5/54b1b57f7287e8d3c4b3bacef08b425363031d15.png)

---

<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:** [March 21, 2017, 3:46am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-cause-shards-unassigned/75811/2 "2017-03-21T03:46:15Z")

</div>

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