# Elastic search cluster with 3 nodes

**URL:** https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076
**Category:** Elasticsearch
**Created:** [August 13, 2018, 6:30am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076 "2018-08-13T06:30:22Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![dinesh1](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dinesh1](https://discuss.elastic.co/u/dinesh1)
#### Post date: [August 13, 2018, 6:30am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/1 "2018-08-13T06:30:23Z")

</div>

Hi,

1.How to configure elasticsearch cluster with 3 nodes

2.How many master nodes i need to configure if i had only 3 nodes to avoid split brain.

3.If had 3 nodes, which node I need to configure in logstash

---

<div class="post-metadata">

### Author: ![Peter\_Steenbergen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_steenbergen/32/22888_2.png) [@Peter\_Steenbergen](https://discuss.elastic.co/u/Peter_Steenbergen)
#### Post date: [August 13, 2018, 6:49am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/2 "2018-08-13T06:49:26Z")

</div>

My suggestion is if you have three nodes, is to setup 2 master eligible servers.  
with a minimum of 2 so that you don't have a split brain situation.

configuration could be:

```
node1 - elasticsearch.yml:
cluster.name: three_node_cluster
node.name: node-1
network.host: _site_
discovery.zen.ping.unicast.hosts: ["192.168.43.1", "192.168.43.2", "192.168.43.3"]
discovery.zen.minimum_master_nodes: 2

node2 - elasticsearch.yml:
cluster.name: three_node_cluster
node.name: node-2
network.host: _site_
discovery.zen.ping.unicast.hosts: ["192.168.43.1", "192.168.43.2", "192.168.43.3"]
discovery.zen.minimum_master_nodes: 2

node3 - elasticsearch.yml:
cluster.name: three_node_cluster
node.name: node-3
network.host: _site_
discovery.zen.ping.unicast.hosts: ["192.168.43.1", "192.168.43.2", "192.168.43.3"]
discovery.zen.minimum_master_nodes: 2

```

To avoid split-brain its best to use (number\_of\_nodes / 2) + 1. In this case 2, but in general we use a maximum of 3 master eligible servers in a cluster.

For logstash you can configure it to connect to multiple IP's of the hosts. All the nodes can coordinate the data.

Mind the firewall settings if you do not use [cloud.elastic.co](http://cloud.elastic.co) which has security by default. I recommend to follow Elastic Engineer 1 - course which gives a good explanation about setting up a cluster.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [August 13, 2018, 6:52am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/3 "2018-08-13T06:52:49Z")

</div>

The ideal number of master eligible nodes is 3, so I would recommend you set up all 3 nodes as master/data. Add the IP address of all nodes to `discovery.zen.ping.unicast.hosts` and set `discovery.zen.minimum_master_nodes` to 2 to avoid split brain scenarios.

---

<div class="post-metadata">

### Author: ![dinesh1](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dinesh1](https://discuss.elastic.co/u/dinesh1)
#### Post date: [August 13, 2018, 6:55am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/4 "2018-08-13T06:55:43Z")

</div>

coordinating node is requred....?

---

<div class="post-metadata">

### Author: ![Peter\_Steenbergen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_steenbergen/32/22888_2.png) [@Peter\_Steenbergen](https://discuss.elastic.co/u/Peter_Steenbergen)
#### Post date: [August 13, 2018, 6:56am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/5 "2018-08-13T06:56:44Z")

</div>

All nodes are default master, data, ingest and coordinating nodes unless you set the boolean to false for that option.

---

<div class="post-metadata">

### Author: ![dinesh1](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dinesh1](https://discuss.elastic.co/u/dinesh1)
#### Post date: [August 13, 2018, 6:59am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/6 "2018-08-13T06:59:09Z")

</div>

consider a scenario  
If I had 3 nodes all are master/data nodes  
192.168.43.1  
192.168.43.2  
192.168.43.3

my logstash is congfigured with 192.168.43.1 server(elasticsearch) and if 192.168.43.1 server is down, at this case what will happen...?

---

<div class="post-metadata">

### Author: ![Peter\_Steenbergen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_steenbergen/32/22888_2.png) [@Peter\_Steenbergen](https://discuss.elastic.co/u/Peter_Steenbergen)
#### Post date: [August 13, 2018, 7:04am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/7 "2018-08-13T07:04:34Z")

</div>

You can set multiple IPs for logstash in your config. I will change the config above to those IPs

```
output {
  elasticsearch {
    host => ["192.168.43.1", "192.168.43.2", "192.168.43.3"]
    ...
  }
}
```

---

<div class="post-metadata">

### Author: ![dinesh1](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dinesh1](https://discuss.elastic.co/u/dinesh1)
#### Post date: [August 13, 2018, 8:02am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/8 "2018-08-13T08:02:35Z")

</div>

logs will go to all 3 servers or single server

---

<div class="post-metadata">

### Author: ![Peter\_Steenbergen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_steenbergen/32/22888_2.png) [@Peter\_Steenbergen](https://discuss.elastic.co/u/Peter_Steenbergen)
#### Post date: [August 13, 2018, 8:03am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/9 "2018-08-13T08:03:05Z")

</div>

It will go to a single server that responds.

---

<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: [September 10, 2018, 8:04am UTC](https://discuss.elastic.co/t/elastic-search-cluster-with-3-nodes/144076/10 "2018-09-10T08:04:53Z")

</div>

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