# Elasticsearch mutli-master setup

**URL:** <https://discuss.elastic.co/t/elasticsearch-mutli-master-setup/153223>\
**Category:** Elasticsearch\
**Created:** [October 19, 2018, 8:04pm UTC](https://discuss.elastic.co/t/elasticsearch-mutli-master-setup/153223 "2018-10-19T20:04:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmadoori](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@rmadoori](https://discuss.elastic.co/u/rmadoori)\
**Post date:** [October 19, 2018, 8:04pm UTC](https://discuss.elastic.co/t/elasticsearch-mutli-master-setup/153223/1 "2018-10-19T20:04:57Z")

</div>

Hi,

we have 1 coordinating-node 1 master-node 5 data-nodes and 1 kibana.  
we are planning to scale it up to 2 coordinating-nodes 3 master-node 30 data-nodes 2 kibana.  
Only coodrinating node is esposed to kibana and logstash (master-node , Data-nodes are not expose all the request are processed by coordinating node)  
Please suggest on following questions:

Is it possible to have multiple masters?  
How does mutli-master setup work is it something like active passive kind of setup ? will one master-node be leader and other 2 are in standby ?  
Can i have 2 coordinating nodes ?  
How can we maintain HA for logstash

Thanks  
Rajesh

---

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [October 20, 2018, 7:14pm UTC](https://discuss.elastic.co/t/elasticsearch-mutli-master-setup/153223/2 "2018-10-20T19:14:14Z")

</div>

hi,  
**Q1. Is it possible to have multiple masters?**  
R: Yes, you can set multiple masters, but one of them elected as master.  
But for preventing split brain you should set minimum\_master\_nodes:  
[https://www.elastic.co/guide/en/elasticsearch/guide/current/important-configuration-changes.html#\_minimum\_master\_nodes](https://www.elastic.co/guide/en/elasticsearch/guide/current/important-configuration-changes.html#_minimum_master_nodes)  
in your case: minimum\_master\_nodes = 2

**Q2: How does mutli-master setup work is it something like active passive kind of setup ? will one master-node be leader and other 2 are in standby ?**  
discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]  
R: 1) set cluster-name  
2) set node-name  
3) on elasticsearch instanses where will be master yo should set:  
node.master: true  
discovery.zen.ping.unicast.hosts: ["host2:port", "host3:port"]  
minimum\_master\_nodes=2  
[https://www.elastic.co/guide/en/elasticsearch/reference/6.4/modules-node.html#master-node](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/modules-node.html#master-node)

**Q3: Can i have 2 coordinating nodes ?**  
R: Yes, you can.  
[https://www.elastic.co/guide/en/elasticsearch/reference/6.4/modules-node.html#coordinating-only-node](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/modules-node.html#coordinating-only-node)

**Q4. How can we maintain HA for logstash?**  
**R: What purpose of using logstash in your case?**

---

<div class="post-metadata">

**Author:** ![rmadoori](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@rmadoori](https://discuss.elastic.co/u/rmadoori)\
**Post date:** [October 20, 2018, 7:52pm UTC](https://discuss.elastic.co/t/elasticsearch-mutli-master-setup/153223/3 "2018-10-20T19:52:56Z")

</div>

Hi @nugusbayevkk

Thanks for the response documentation is helpfull  
Use case for logstash is we are currently running 2 logstash instances one for kafka and one for http input  
We wanted to know can we have lostash for failover like if logstash is down 2nd one picks up with 0 downtime

---

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [October 21, 2018, 9:55am UTC](https://discuss.elastic.co/t/elasticsearch-mutli-master-setup/153223/4 "2018-10-21T09:55:57Z")

</div>

what logstash output are you use?

logstash can work with several input, so you can in every instance of logstash handle input http traffic and read from kafka topics

for example, took 2 logstash instances working on (server1, server2):

1. http input  
http input work on port for example 8085

so for HA you should use some Load Balancing proxy that redirect to one of available Logstash instances:  
server1:8085 or server2:8085.  
2) kafka input  
in case of kafka i don't know how achieve HA of logstash, because if you run 2 instances of logstash then data will duplicate when reading from same topic. And you should implement some de-duplicate mechanism.  
May be exist some configurations on kafka topics, limitations of max consumer connections.

---

<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:** [November 18, 2018, 9:55am UTC](https://discuss.elastic.co/t/elasticsearch-mutli-master-setup/153223/5 "2018-11-18T09:55:57Z")

</div>

Closed on November 18, 2018, 9:55am UTC

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