# MasterNotDiscoveredException for all queries

**URL:** <https://discuss.elastic.co/t/masternotdiscoveredexception-for-all-queries/38360>\
**Category:** Elasticsearch\
**Created:** [January 5, 2016, 2:28am UTC](https://discuss.elastic.co/t/masternotdiscoveredexception-for-all-queries/38360 "2016-01-05T02:28:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreKR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrekr/32/6233_2.png) [@AndreKR](https://discuss.elastic.co/u/AndreKR)\
**Post date:** [January 5, 2016, 2:28am UTC](https://discuss.elastic.co/t/masternotdiscoveredexception-for-all-queries/38360/1 "2016-01-05T02:28:04Z")

</div>

I am running ELasticsearch 2.1.0 on Windows. I have one node and I have configured `discovery.zen.minimum_master_nodes: 2`. I haven't configured `discovery.zen.no_master_block` at all, so it should have [its default](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-zen.html#no-master-block) `write`.

Every query I run, including cluster health, list of indices, etc., hangs for 30s and then aborts with

```
{
  "error" : {
    "root_cause" : [ {
      "type" : "master_not_discovered_exception",
      "reason" : "waited for [30s]"
    } ],
    "type" : "master_not_discovered_exception",
    "reason" : "waited for [30s]"
  },
  "status" : 503
}
```

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [January 5, 2016, 2:42am UTC](https://discuss.elastic.co/t/masternotdiscoveredexception-for-all-queries/38360/2 "2016-01-05T02:42:56Z")

</div>

Does it happen when the node first starts and can't find the master? I believe you'll get that error there because the node just doesn't know if its data is anywhere near current without connecting to the master for the first time. I imagine `no_master_block` is for after its connected to the cluster if the master drops out. I haven't dug into that code but that has been my experience so I might not be right.

---

<div class="post-metadata">

**Author:** ![AndreKR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrekr/32/6233_2.png) [@AndreKR](https://discuss.elastic.co/u/AndreKR)\
**Post date:** [January 5, 2016, 3:09am UTC](https://discuss.elastic.co/t/masternotdiscoveredexception-for-all-queries/38360/3 "2016-01-05T03:09:50Z")

</div>

What I did exactly was:

- Download Elasticsearch, unzip
- Start up one node, index some data
- Start it up a second time, it joins the cluster
- PUT `{"persistent":{"discovery.zen.minimum_master_nodes":2}}` to `_cluster/settings`
- End the second instance

Now it shows the described behavior.

---

<div class="post-metadata">

**Author:** ![AndreKR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrekr/32/6233_2.png) [@AndreKR](https://discuss.elastic.co/u/AndreKR)\
**Post date:** [January 8, 2016, 4:58am UTC](https://discuss.elastic.co/t/masternotdiscoveredexception-for-all-queries/38360/4 "2016-01-08T04:58:45Z")

</div>

Never mind. (Unless you do?) I thought requests like `GET /_cat/indices`, `GET /_cluster/setting` and `GET /_cluster/health` would count as read operations. As it seems they don't. Actually querying an index works just fine in a no-master situation.

---

<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 5, 2017, 11:26pm UTC](https://discuss.elastic.co/t/masternotdiscoveredexception-for-all-queries/38360/5 "2017-07-05T23:26:12Z")

</div>

Closed on July 5, 2017, 11:26pm UTC


