# Minimum\_master\_nodes prevent nodes from joining the cluster

**URL:** <https://discuss.elastic.co/t/minimum-master-nodes-prevent-nodes-from-joining-the-cluster/5026>\
**Category:** Elasticsearch\
**Created:** [August 2, 2011, 8:52am UTC](https://discuss.elastic.co/t/minimum-master-nodes-prevent-nodes-from-joining-the-cluster/5026 "2011-08-02T08:52:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michel\_Conrad](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michel\_Conrad](https://discuss.elastic.co/u/Michel_Conrad)\
**Post date:** [August 2, 2011, 8:52am UTC](https://discuss.elastic.co/t/minimum-master-nodes-prevent-nodes-from-joining-the-cluster/5026/1 "2011-08-02T08:52:31Z")

</div>

Hi,  
Thanks Shay for the extensive debugging yesterday on IRC.  
Everything seems much clearer now, but I think I found a situation  
where the cluster joining  
does not work as expected.

I got the following situation during startup:

minimum\_master\_nodes set to 3  
master:true on 5 nodes,  
master:false on the other nodes.  
unicast discovery with hosts set to the 5 nodes that can become master.

During the initial cluster everything works fine, a master is elected  
and the other nodes join the cluster.

If I remove a non-master node from cluster, then try to join again the  
node does not join anymore.  
It only gets a ping response from the elected master and does not join  
the cluster. I suspect its because minimum\_master\_nodes is  
set to 3 and the unelected masters are somehow not responding to the ping.

If I restart another node, the first node gets a ping response from  
the master (with master=true, [master=Cerberus...] and from the other  
node that tries to join the cluster (with master=false, master  
[null]). Still not joining any cluster.

Only if I set minimum\_master\_nodes to 1 the node joins the cluster,  
but I thought that I wanted that the node  
can only join a cluster with 3 master nodes, to prevent split-brains.  
Or does it already prevent split-brains if I  
set minimum\_master\_nodes to 3 for the master:true nodes, and  
minimum\_master\_nodes to 1 for the master:false nodes?  
The only thing I suspect is that if I restart one of the 5 master:true  
nodes, that one also cannot join the cluster again.

Best,  
Michel

---

<div class="post-metadata">

**Author:** ![Michel\_Conrad](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michel\_Conrad](https://discuss.elastic.co/u/Michel_Conrad)\
**Post date:** [August 2, 2011, 10:14am UTC](https://discuss.elastic.co/t/minimum-master-nodes-prevent-nodes-from-joining-the-cluster/5026/2 "2011-08-02T10:14:24Z")

</div>

Hi,  
changing the configuration file solved the joining issue:

When the hosts are comma separated and there is a whitespace after the  
comma, the debug message prints correctly:  
[DEBUG][discovery.zen.ping.unicast] [Jackson Arvad] using initial  
hosts [192.168.5.1[9300], 192.168.5.2[9300], 192.168.5.3[9300],  
192.168.5.4[9300], 192.168.5.5[9300]]

But only the first host is being used, the other four give an  
java.nio.channels.UnresolvedAddressException on the netty layer.

I think it would be helpful if the addresses would be trimmed before  
being passed to netty or if it would be possible to give a warning in  
order to avoid similar errors in the future.

Regards,  
Michel

On Tue, Aug 2, 2011 at 10:52 AM, Michel Conrad  
[michel.conrad@trendiction.com](mailto:michel.conrad@trendiction.com) wrote:

> Hi,  
> Thanks Shay for the extensive debugging yesterday on IRC.  
> Everything seems much clearer now, but I think I found a situation  
> where the cluster joining  
> does not work as expected.
> 
> I got the following situation during startup:
> 
> minimum\_master\_nodes set to 3  
> master:true on 5 nodes,  
> master:false on the other nodes.  
> unicast discovery with hosts set to the 5 nodes that can become master.
> 
> During the initial cluster everything works fine, a master is elected  
> and the other nodes join the cluster.
> 
> If I remove a non-master node from cluster, then try to join again the  
> node does not join anymore.  
> It only gets a ping response from the elected master and does not join  
> the cluster. I suspect its because minimum\_master\_nodes is  
> set to 3 and the unelected masters are somehow not responding to the ping.
> 
> If I restart another node, the first node gets a ping response from  
> the master (with master=true, [master=Cerberus...] and from the other  
> node that tries to join the cluster (with master=false, master  
> [null]). Still not joining any cluster.
> 
> Only if I set minimum\_master\_nodes to 1 the node joins the cluster,  
> but I thought that I wanted that the node  
> can only join a cluster with 3 master nodes, to prevent split-brains.  
> Or does it already prevent split-brains if I  
> set minimum\_master\_nodes to 3 for the master:true nodes, and  
> minimum\_master\_nodes to 1 for the master:false nodes?  
> The only thing I suspect is that if I restart one of the 5 master:true  
> nodes, that one also cannot join the cluster again.
> 
> Best,  
> Michel

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 2, 2011, 10:30am UTC](https://discuss.elastic.co/t/minimum-master-nodes-prevent-nodes-from-joining-the-cluster/5026/3 "2011-08-02T10:30:52Z")

</div>

:).., that explains a lot of the things we saw yesterday then..., I opened  
an issue: [Unicast Discovery: When providing a comma separated list of addresses, trim them from whitespaces · Issue #1193 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1193).

On Tue, Aug 2, 2011 at 1:14 PM, Michel Conrad \<[michel.conrad@trendiction.com](mailto:michel.conrad@trendiction.com)

> wrote:

> Hi,  
> changing the configuration file solved the joining issue:
> 
> When the hosts are comma separated and there is a whitespace after the  
> comma, the debug message prints correctly:  
> [DEBUG][discovery.zen.ping.unicast] [Jackson Arvad] using initial  
> hosts [192.168.5.1[9300], 192.168.5.2[9300], 192.168.5.3[9300],  
> 192.168.5.4[9300], 192.168.5.5[9300]]
> 
> But only the first host is being used, the other four give an  
> java.nio.channels.UnresolvedAddressException on the netty layer.
> 
> I think it would be helpful if the addresses would be trimmed before  
> being passed to netty or if it would be possible to give a warning in  
> order to avoid similar errors in the future.
> 
> Regards,  
> Michel
> 
> On Tue, Aug 2, 2011 at 10:52 AM, Michel Conrad  
> [michel.conrad@trendiction.com](mailto:michel.conrad@trendiction.com) wrote:
> 
> > Hi,  
> > Thanks Shay for the extensive debugging yesterday on IRC.  
> > Everything seems much clearer now, but I think I found a situation  
> > where the cluster joining  
> > does not work as expected.
> > 
> > I got the following situation during startup:
> > 
> > minimum\_master\_nodes set to 3  
> > master:true on 5 nodes,  
> > master:false on the other nodes.  
> > unicast discovery with hosts set to the 5 nodes that can become master.
> > 
> > During the initial cluster everything works fine, a master is elected  
> > and the other nodes join the cluster.
> > 
> > If I remove a non-master node from cluster, then try to join again the  
> > node does not join anymore.  
> > It only gets a ping response from the elected master and does not join  
> > the cluster. I suspect its because minimum\_master\_nodes is  
> > set to 3 and the unelected masters are somehow not responding to the  
> > ping.
> > 
> > If I restart another node, the first node gets a ping response from  
> > the master (with master=true, [master=Cerberus...] and from the other  
> > node that tries to join the cluster (with master=false, master  
> > [null]). Still not joining any cluster.
> > 
> > Only if I set minimum\_master\_nodes to 1 the node joins the cluster,  
> > but I thought that I wanted that the node  
> > can only join a cluster with 3 master nodes, to prevent split-brains.  
> > Or does it already prevent split-brains if I  
> > set minimum\_master\_nodes to 3 for the master:true nodes, and  
> > minimum\_master\_nodes to 1 for the master:false nodes?  
> > The only thing I suspect is that if I restart one of the 5 master:true  
> > nodes, that one also cannot join the cluster again.
> > 
> > Best,  
> > Michel

---

<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, 3:58am UTC](https://discuss.elastic.co/t/minimum-master-nodes-prevent-nodes-from-joining-the-cluster/5026/4 "2017-07-06T03:58:32Z")

</div>

Closed on July 6, 2017, 3:58am UTC


