# Node roles distribution

**URL:** <https://discuss.elastic.co/t/node-roles-distribution/289373>\
**Category:** Elasticsearch\
**Created:** [November 16, 2021, 11:40pm UTC](https://discuss.elastic.co/t/node-roles-distribution/289373 "2021-11-16T23:40:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gutierrezfj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gutierrezfj/32/92727_2.png) [@gutierrezfj](https://discuss.elastic.co/u/gutierrezfj)\
**Post date:** [November 16, 2021, 11:40pm UTC](https://discuss.elastic.co/t/node-roles-distribution/289373/1 "2021-11-16T23:40:48Z")

</div>

Hi community,  
I have 4 hosts to dedicate to Elasticsearch, what is the best distribution of master and data nodes as well as primary shards and replicas?  
thanks

---

<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:** [November 16, 2021, 11:47pm UTC](https://discuss.elastic.co/t/node-roles-distribution/289373/2 "2021-11-16T23:47:27Z")

</div>

Make them all master and data nodes. However you really need an odd number of nodes here, as the majority of 3 is 4, so you can only survive one node being lost.

As for sharding, it depends on your data type, size and volume.

---

<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:** [December 14, 2021, 11:48pm UTC](https://discuss.elastic.co/t/node-roles-distribution/289373/3 "2021-12-14T23:48:28Z")

</div>

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