# No cluster health with 2 nodes

**URL:** <https://discuss.elastic.co/t/no-cluster-health-with-2-nodes/66249>\
**Category:** Elasticsearch\
**Created:** [November 16, 2016, 1:26pm UTC](https://discuss.elastic.co/t/no-cluster-health-with-2-nodes/66249 "2016-11-16T13:26:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![trenzalore](https://avatars.discourse-cdn.com/v4/letter/t/ac91a4/32.png) [@trenzalore](https://discuss.elastic.co/u/trenzalore)\
**Post date:** [November 16, 2016, 1:26pm UTC](https://discuss.elastic.co/t/no-cluster-health-with-2-nodes/66249/1 "2016-11-16T13:26:09Z")

</div>

Hi !

I created a script to automate the installation of elasticsearch 5.  
It works fine.  
But now I have a problem with elasticsearch: I can't have the cluster health and I have several errors.

first the elasticsearch config:

```
network.bind_host: 0.0.0.0
network.publish_host: 10.136.1.123 (the ip of the host)
discovery.zen.minimum_master_nodes: 2
node.name: Aquaman
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["liprd071.adellego.com", "liprd073.adellego.com", "liprd074.adellego.com"] (not the same for all the node)

```

The thing is when I put curl -XGET 'localhost:9200/\_cluster/health?pretty', I've got nothing (It doesn't stop)

And this is a part of the log:  
[2016-11-16T14:23:29,768][ERROR][o.e.g.GatewayService] [Superman] unexpected failure during [local-gateway-elected-state]  
org.elasticsearch.cluster.NotMasterException: no longer master. source: [local-gateway-elected-state]  
[2016-11-16T14:23:29,768][INFO][o.e.g.GatewayService] [Superman] metadata state not restored, reason: failed to updated cluster state  
[2016-11-16T14:23:32,763][INFO][o.e.c.s.ClusterService] [Superman] new\_master {Superman}{EWHY0pBdRS6jEyTmE\_HJdw}{xybavZhcR0yZ9wDpjHUVTQ}{10.136.1.115}{10.136.1.115:9300}, reason: zen-disco-elected-as-master ([1] nodes joined)[{l1BSU3u}{l1BSU3uLRwiA4Jelt-LKYw}{vC6v6nYcQTiwONQOSkoz8w}{127.0.0.1}{127.0.0.1:9300}]  
[2016-11-16T14:24:02,763][WARN][o.e.d.z.p.PublishClusterStateAction] [Superman] timed out waiting for all nodes to process published state [21] (timeout [30s], pending nodes: [{l1BSU3u}{l1BSU3uLRwiA4Jelt-LKYw}{vC6v6nYcQTiwONQOSkoz8w}{127.0.0.1}{127.0.0.1:9300}])  
[2016-11-16T14:24:02,764][WARN][o.e.c.s.ClusterService] [Superman] cluster state update task [zen-disco-elected-as-master ([1] nodes joined)[{l1BSU3u}{l1BSU3uLRwiA4Jelt-LKYw}{vC6v6nYcQTiwONQOSkoz8w}{127.0.0.1}{127.0.0.1:9300}]] took [30s] above the warn threshold of 30s  
[2016-11-16T14:24:02,764][WARN][o.e.d.z.ZenDiscovery] [Superman] discovered [{Superman}{EWHY0pBdRS6jEyTmE\_HJdw}{xybavZhcR0yZ9wDpjHUVTQ}{10.136.1.115}{10.136.1.115:9300}] which is also master but with an older cluster\_state, telling [{Superman}{EWHY0pBdRS6jEyTmE\_HJdw}{xybavZhcR0yZ9wDpjHUVTQ}{10.136.1.115}{10.136.1.115:9300}] to rejoin the cluster ([via a new cluster state])  
[2016-11-16T14:24:02,765][WARN][o.e.d.z.ZenDiscovery] [Superman] received a request to rejoin the cluster from [EWHY0pBdRS6jEyTmE\_HJdw], current nodes: {{Superman}{EWHY0pBdRS6jEyTmE\_HJdw}{xybavZhcR0yZ9wDpjHUVTQ}{10.136.1.115}{10.136.1.115:9300},{Aquaman}{fwYilkxgQgWSMsk673R6ww}{YVly9M3GTCaKNwTgugxV8A}{10.136.1.123}{10.136.1.123:9300},{l1BSU3u}{l1BSU3uLRwiA4Jelt-LKYw}{vC6v6nYcQTiwONQOSkoz8w}{127.0.0.1}{127.0.0.1:9300},}  
[2016-11-16T14:24:02,773][ERROR][o.e.g.GatewayService] [Superman] unexpected failure during [local-gateway-elected-state]  
org.elasticsearch.cluster.NotMasterException: no longer master. source: [local-gateway-elected-state]  
[2016-11-16T14:24:02,773][INFO][o.e.g.GatewayService] [Superman] metadata state not restored, reason: failed to updated cluster state  
[2016-11-16T14:24:05,890][INFO][o.e.c.s.ClusterService] [Superman] new\_master {Superman}{EWHY0pBdRS6jEyTmE\_HJdw}{xybavZhcR0yZ9wDpjHUVTQ}{10.136.1.115}{10.136.1.115:9300}, reason: zen-disco-elected-as-master ([1] nodes joined)[{Aquaman}{fwYilkxgQgWSMsk673R6ww}{YVly9M3GTCaKNwTgugxV8A}{10.136.1.123}{10.136.1.123:9300}]

Superman is the first node and Aquaman the second.  
What have I done wrong ?  
Thank you !

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [November 16, 2016, 1:55pm UTC](https://discuss.elastic.co/t/no-cluster-health-with-2-nodes/66249/2 "2016-11-16T13:55:25Z")

</div>

You should read : [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-discovery-zen.html#master-election](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-discovery-zen.html#master-election)

```
This setting must be set to a quorum of your master eligible nodes. It is recommended to avoid having 
only two master eligible nodes, since a quorum of two is two. Therefore, a loss of either master 
eligible node will result in an inoperable cluster.
```

---

<div class="post-metadata">

**Author:** ![trenzalore](https://avatars.discourse-cdn.com/v4/letter/t/ac91a4/32.png) [@trenzalore](https://discuss.elastic.co/u/trenzalore)\
**Post date:** [November 16, 2016, 2:15pm UTC](https://discuss.elastic.co/t/no-cluster-health-with-2-nodes/66249/3 "2016-11-16T14:15:45Z")

</div>

You're not help I deserved but the I help I needed !

Thanks a lot, Cluster green !

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [November 16, 2016, 2:28pm UTC](https://discuss.elastic.co/t/no-cluster-health-with-2-nodes/66249/4 "2016-11-16T14:28:39Z")

</div>

👍

---

<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, 2016, 2:28pm UTC](https://discuss.elastic.co/t/no-cluster-health-with-2-nodes/66249/5 "2016-12-14T14:28:48Z")

</div>

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