# How to plan and implement shard allocation awareness for the below 3 master 6 data node setup

**URL:** <https://discuss.elastic.co/t/how-to-plan-and-implement-shard-allocation-awareness-for-the-below-3-master-6-data-node-setup/325858>\
**Category:** Elasticsearch\
**Created:** [February 17, 2023, 3:23pm UTC](https://discuss.elastic.co/t/how-to-plan-and-implement-shard-allocation-awareness-for-the-below-3-master-6-data-node-setup/325858 "2023-02-17T15:23:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![H\_K7](https://avatars.discourse-cdn.com/v4/letter/h/4da419/32.png) [@H\_K7](https://discuss.elastic.co/u/H_K7)\
**Post date:** [February 17, 2023, 3:23pm UTC](https://discuss.elastic.co/t/how-to-plan-and-implement-shard-allocation-awareness-for-the-below-3-master-6-data-node-setup/325858/1 "2023-02-17T15:23:27Z")

</div>

Current setup hosted in aws ec2, self managed/hosted opensource version of elasticsearch

```auto
master-1 - us-east-1a
master-2 - us-east-1b
master-2 - us-east-1c

data-1 - us-east-1a
data-2 - us-east-1b
data-3 - us-east-1c
data-4 - us-east-1d
data-5 - us-east-1f
data-6 - us-east-1a

```

My plan  
Adding below config to the elasticsearch.yml and restarting service one node at a time

data-1

```auto

node.attr.zone: us-east-1a 
cluster.routing.allocation.awareness.attributes: zone

```

restart elasticsearch service

data-2

```auto

node.attr.zone: us-east-1b 
cluster.routing.allocation.awareness.attributes: zone

```

restart elasticsearch service

data-3

```auto
node.attr.zone: us-east-1c 
cluster.routing.allocation.awareness.attributes: zone

```

restart elasticsearch service

data-4

```auto

node.attr.zone: us-east-1d 
cluster.routing.allocation.awareness.attributes: zone

```

restart elasticsearch service

data-5

```auto
node.attr.zone: us-east-1f
cluster.routing.allocation.awareness.attributes: zone

```

restart elasticsearch service

data-6

```auto

node.attr.zone: us-east-1a
cluster.routing.allocation.awareness.attributes: zone

```

restart elasticsearch service

**run from kibana dev tools**

```auto
PUT _cluster/settings
{
  "persistent": {
    "cluster.routing.allocation.awareness.attributes": "zone",
    "cluster.routing.allocation.awareness.force.zone.values": "us-east-1a ,us-east-1b,us-east-1c,us-east-1d,us-east-1f"
  }
}

```

Note: data-1 and data-6 are in the same az.

Does my plan look good with the above setup ? And should the same setting be applied for **master nodes** as well in similar manner to the data nodes ?

How can I validate after the above steps to make sure things are good ?

---

<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 17, 2023, 3:23pm UTC](https://discuss.elastic.co/t/how-to-plan-and-implement-shard-allocation-awareness-for-the-below-3-master-6-data-node-setup/325858/2 "2023-03-17T15:23:55Z")

</div>

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