# How to restrict shard and replica to specific node

**URL:** https://discuss.elastic.co/t/how-to-restrict-shard-and-replica-to-specific-node/230271
**Category:** Elasticsearch
**Created:** [April 28, 2020, 11:37pm UTC](https://discuss.elastic.co/t/how-to-restrict-shard-and-replica-to-specific-node/230271 "2020-04-28T23:37:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Taewoo](https://avatars.discourse-cdn.com/v4/letter/t/5f9b8f/32.png) [@Taewoo](https://discuss.elastic.co/u/Taewoo)
#### Post date: [April 28, 2020, 11:37pm UTC](https://discuss.elastic.co/t/how-to-restrict-shard-and-replica-to-specific-node/230271/1 "2020-04-28T23:37:57Z")

</div>

Hello? I'm newbie to Elasticsearch.

Consider there are 1 master nodes and 6 data nodes(A,B,C,D,E,F).

I'd like to put 'log\_a' index's shard and replica to first three nodes(A,B,C).  
I'd like to put 'lob\_b' index's shard and replica to other nodes(D,E,F).

Is this scenario possible?  
If it is, then how can I implement it?

I just want to allocate specific index's shard(primary and replica) and replica to specific set of nodes.

---

<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: [April 28, 2020, 11:42pm UTC](https://discuss.elastic.co/t/how-to-restrict-shard-and-replica-to-specific-node/230271/2 "2020-04-28T23:42:58Z")

</div>

You can use [allocation filtering](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/shard-allocation-filtering.html) to do this. However it won't distinguish between primary and replica.

---

<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: [May 26, 2020, 11:43pm UTC](https://discuss.elastic.co/t/how-to-restrict-shard-and-replica-to-specific-node/230271/3 "2020-05-26T23:43:04Z")

</div>

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