# Help with 4 node cluster

**URL:** <https://discuss.elastic.co/t/help-with-4-node-cluster/22234>\
**Category:** Elasticsearch\
**Created:** [February 18, 2015, 11:39am UTC](https://discuss.elastic.co/t/help-with-4-node-cluster/22234 "2015-02-18T11:39:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sysads](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@sysads](https://discuss.elastic.co/u/sysads)\
**Post date:** [February 18, 2015, 11:39am UTC](https://discuss.elastic.co/t/help-with-4-node-cluster/22234/1 "2015-02-18T11:39:54Z")

</div>

Hi

I am in need of help on setting up a 4 node elasticsearch servers. I have  
installed and configured ES on all 4 nodes but I am lost as to what the  
configuration in elasticsearch.yml will be:

- if I want to have all 4 nodes both master and data
- make node A act as primary shard while node B acts as its replica then  
node C as primary shard while node D as its own replica.

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ff3ad49c-f305-44cb-a473-523ad6758835%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ff3ad49c-f305-44cb-a473-523ad6758835%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [February 19, 2015, 1:38am UTC](https://discuss.elastic.co/t/help-with-4-node-cluster/22234/2 "2015-02-19T01:38:26Z")

</div>

Take a look at these pages -

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Also there is not really any point in forcing shard types on specific  
machines, unless you want to leverage some kind of awareness. A primary and  
replica shard are the same thing other than a metadata flag that  
differentiates them.

On 18 February 2015 at 22:39, sysads [sysadmin-6571@pages.plusgoogle.com](mailto:sysadmin-6571@pages.plusgoogle.com)  
wrote:

> Hi
> 
> I am in need of help on setting up a 4 node elasticsearch servers. I have  
> installed and configured ES on all 4 nodes but I am lost as to what the  
> configuration in elasticsearch.yml will be:
> 
> - if I want to have all 4 nodes both master and data
> - make node A act as primary shard while node B acts as its replica then  
> node C as primary shard while node D as its own replica.
> 
> Thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/ff3ad49c-f305-44cb-a473-523ad6758835%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ff3ad49c-f305-44cb-a473-523ad6758835%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/ff3ad49c-f305-44cb-a473-523ad6758835%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/ff3ad49c-f305-44cb-a473-523ad6758835%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8s8Xn%3DZncku8JWBCGFPSM1hoNtbCSFUXrCb0EaR-d%3DJg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8s8Xn%3DZncku8JWBCGFPSM1hoNtbCSFUXrCb0EaR-d%3DJg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nalzapur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nalzapur/32/899_2.png) [@nalzapur](https://discuss.elastic.co/u/nalzapur)\
**Post date:** [February 19, 2015, 1:54am UTC](https://discuss.elastic.co/t/help-with-4-node-cluster/22234/3 "2015-02-19T01:54:46Z")

</div>

you can make all nodes as master + data by setting following in  
elasticsearch.yml file. i dont think/know if you can setup 2 nodes as  
primary in cluster. For each index, you can set number of replica as 1 or  
more, so ES will automatically move them to different nodes than primary  
shard. i recommend using unicast for discovery as shown below if you have  
static IPs.

node.master: true  
node.data: true  
discovery.zen.ping.multicast.enabled: false  
discovery.zen.ping.unicast.hosts: ["IP1", "IP2"]

On Wednesday, February 18, 2015 at 5:39:54 AM UTC-6, sysads wrote:

> Hi
> 
> I am in need of help on setting up a 4 node elasticsearch servers. I have  
> installed and configured ES on all 4 nodes but I am lost as to what the  
> configuration in elasticsearch.yml will be:
> 
> - if I want to have all 4 nodes both master and data
> - make node A act as primary shard while node B acts as its replica then  
> node C as primary shard while node D as its own replica.
> 
> Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e73c6d3e-e0dd-4403-87d9-3ab922bb974f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e73c6d3e-e0dd-4403-87d9-3ab922bb974f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![cdahlqvist](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cdahlqvist](https://discuss.elastic.co/u/cdahlqvist)\
**Post date:** [February 19, 2015, 5:51am UTC](https://discuss.elastic.co/t/help-with-4-node-cluster/22234/4 "2015-02-19T05:51:28Z")

</div>

Hi,

You always want an odd number of master nodes (often 3), so I would  
therefore recommend setting three of the four nodes to be master eligible  
and leave the fourth as a pure data node. This will prevent the cluster  
getting partitioned into two with equal number of master nodes on both  
sides of the partition.

Best regards,

Christian

On Wednesday, February 18, 2015 at 11:39:54 AM UTC, sysads wrote:

> Hi
> 
> I am in need of help on setting up a 4 node elasticsearch servers. I have  
> installed and configured ES on all 4 nodes but I am lost as to what the  
> configuration in elasticsearch.yml will be:
> 
> - if I want to have all 4 nodes both master and data
> - make node A act as primary shard while node B acts as its replica then  
> node C as primary shard while node D as its own replica.
> 
> Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/956bd6e5-44fa-448e-93aa-9a7623972b42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/956bd6e5-44fa-448e-93aa-9a7623972b42%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [February 19, 2015, 10:47pm UTC](https://discuss.elastic.co/t/help-with-4-node-cluster/22234/5 "2015-02-19T22:47:32Z")

</div>

You can have 4 master eligable  
​if you want​  
, just set discovery.zen.minimum\_master\_nodes  
​ to 3 to ensure a quorum.​

But ideally as Christian mentioned, it's best to have an uneven number of  
masters.

On 19 February 2015 at 16:51, [christian.dahlqvist@elasticsearch.com](mailto:christian.dahlqvist@elasticsearch.com) wrote:

> Hi,
> 
> You always want an odd number of master nodes (often 3), so I would  
> therefore recommend setting three of the four nodes to be master eligible  
> and leave the fourth as a pure data node. This will prevent the cluster  
> getting partitioned into two with equal number of master nodes on both  
> sides of the partition.
> 
> Best regards,
> 
> Christian
> 
> On Wednesday, February 18, 2015 at 11:39:54 AM UTC, sysads wrote:
> 
> > Hi
> > 
> > I am in need of help on setting up a 4 node elasticsearch servers. I  
> > have installed and configured ES on all 4 nodes but I am lost as to what  
> > the configuration in elasticsearch.yml will be:
> > 
> > - if I want to have all 4 nodes both master and data
> > - make node A act as primary shard while node B acts as its replica then  
> > node C as primary shard while node D as its own replica.
> > 
> > Thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/956bd6e5-44fa-448e-93aa-9a7623972b42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/956bd6e5-44fa-448e-93aa-9a7623972b42%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/956bd6e5-44fa-448e-93aa-9a7623972b42%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/956bd6e5-44fa-448e-93aa-9a7623972b42%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-hffk5m\_ORJ9\_LdmBqgcK2QLMCvwpuQhVJRzRvM1A8tg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-hffk5m_ORJ9_LdmBqgcK2QLMCvwpuQhVJRzRvM1A8tg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:31am UTC](https://discuss.elastic.co/t/help-with-4-node-cluster/22234/6 "2017-07-06T00:31:24Z")

</div>


