# Unable to create primary shard in hot-1 and replica shard in hot-2

**URL:** <https://discuss.elastic.co/t/unable-to-create-primary-shard-in-hot-1-and-replica-shard-in-hot-2/261606>\
**Category:** Elasticsearch\
**Created:** [January 20, 2021, 12:48am UTC](https://discuss.elastic.co/t/unable-to-create-primary-shard-in-hot-1-and-replica-shard-in-hot-2/261606 "2021-01-20T00:48:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris\_lawrence](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@aris\_lawrence](https://discuss.elastic.co/u/aris_lawrence)\
**Post date:** [January 20, 2021, 12:48am UTC](https://discuss.elastic.co/t/unable-to-create-primary-shard-in-hot-1-and-replica-shard-in-hot-2/261606/1 "2021-01-20T00:48:31Z")

</div>

Elasticsearch version 7.7.1

We have the following setup in our elastic environment.  
3 master only  
2 ingest only  
2 hot nodes (hot-1-p1 and hot-2-p1)  
2 warm nodes (warm-1-p1 and warm-2-p1)  
1 cold node (cold-p1)

```auto
master node configuration
routing:
  allocation:
    enable: all
    awareness.attributes: rack_id
    disk.watermark.low: 80%
    disk.watermark.high: 85%
    disk.watermark.flood_stage: 88%

hot node configuration
node:
  name: hot-1-p1 #hot-2-p1 for the second 
  attr.rack: hot
  attr.rack_id: hot
  attr.box_type: hot
  attr.data: hot
  master: false
  data: true
  ingest: false

warm node configuration
node:
  name: warm-1-p1 #warm-2-p1 for the second 
  attr.rack: warm
  attr.rack_id: warm
  attr.box_type: warm
  attr.data: warm
  master: false
  data: true
  ingest: false

cold node configuration
node:
  name: cold-p1
  attr.rack: cold
  attr.rack_id: cold
  attr.box_type: cold
  attr.data: cold
  master: false
  data: true
  ingest: false

index template
setup.template.settings:
  index.number_of_shards:1
  index.number_of_replicas: 1

```

I am trying to create 1 primary and 1 replica shard but the replica is being created in warm node. Is it possible to create the 1 primary to "hot-1 or hot-2" and the replica to "hot-2 or hot-1"?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 20, 2021, 12:50am UTC](https://discuss.elastic.co/t/unable-to-create-primary-shard-in-hot-1-and-replica-shard-in-hot-2/261606/2 "2021-01-20T00:50:41Z")

</div>

You need to add the filtering attribution to the index as well, check out [https://www.elastic.co/guide/en/elasticsearch/reference/7.10/shard-allocation-filtering.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/shard-allocation-filtering.html)

---

<div class="post-metadata">

**Author:** ![aris\_lawrence](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@aris\_lawrence](https://discuss.elastic.co/u/aris_lawrence)\
**Post date:** [January 20, 2021, 1:05am UTC](https://discuss.elastic.co/t/unable-to-create-primary-shard-in-hot-1-and-replica-shard-in-hot-2/261606/3 "2021-01-20T01:05:47Z")

</div>

I've added ![1-20-2021 9-02-55 AM](https://us1.discourse-cdn.com/elastic/original/3X/2/0/209dab46b17e34d0c4da3276be9ee7f5cce5b2db.png)

This is the result ![1-20-2021 9-03-56 AM](https://us1.discourse-cdn.com/elastic/original/3X/6/2/62a2f9018fd095881de3bb02858fc49dc1d1d46b.png)

 ![1-20-2021 9-05-26 AM](https://us1.discourse-cdn.com/elastic/original/3X/9/b/9b2772d8abd8062b7131939133d13cb14adbdccd.png)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 20, 2021, 1:06am UTC](https://discuss.elastic.co/t/unable-to-create-primary-shard-in-hot-1-and-replica-shard-in-hot-2/261606/4 "2021-01-20T01:06:26Z")

</div>

What does [https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html) show?

---

<div class="post-metadata">

**Author:** ![aris\_lawrence](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@aris\_lawrence](https://discuss.elastic.co/u/aris_lawrence)\
**Post date:** [January 20, 2021, 1:15am UTC](https://discuss.elastic.co/t/unable-to-create-primary-shard-in-hot-1-and-replica-shard-in-hot-2/261606/5 "2021-01-20T01:15:12Z")

</div>

Sorry but i can only upload images since copy/paste is disabled between my computer and the server.

 ![1-20-2021 9-10-31 AM](https://us1.discourse-cdn.com/elastic/original/3X/0/8/088c9a8dace928e14dffb60c8bc29e732038066f.png)

 ![1-20-2021 9-11-12 AM](https://us1.discourse-cdn.com/elastic/original/3X/d/1/d174f86d71674c48b3c499c5109489fc90096bbd.png)

 ![1-20-2021 9-11-43 AM](https://us1.discourse-cdn.com/elastic/original/3X/a/3/a3f4fcf3fcfe6cd3d28652aba82e01b0bfc347af.png)

EDITED: I may need to remove some of the attr in the yml file and experiment with the filtering.

---

<div class="post-metadata">

**Author:** ![aris\_lawrence](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@aris\_lawrence](https://discuss.elastic.co/u/aris_lawrence)\
**Post date:** [January 20, 2021, 4:45am UTC](https://discuss.elastic.co/t/unable-to-create-primary-shard-in-hot-1-and-replica-shard-in-hot-2/261606/6 "2021-01-20T04:45:17Z")

</div>

Ok, i finally figured it out. It was the awareness that was causing the trouble and "maybe" the other attributes.

On the master nodes elasticsearch.yml, i removed "routing.allocation.awareness.attributes".  
On the data nodes (hot/warm/cold), i only retained "node.attr.data"  
On the index templates, i changed it to "index.routing.allocation.require.data: hot"

![1-20-2021 12-44-16 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4ac1b5c8c6f71f0b44895102f0142be7a2d81352.png)

Thanks for the assistance.

---

<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:** [February 17, 2021, 4:45am UTC](https://discuss.elastic.co/t/unable-to-create-primary-shard-in-hot-1-and-replica-shard-in-hot-2/261606/7 "2021-02-17T04:45:31Z")

</div>

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