# Getting org.elasticsearch.discovery.MasterNotDiscoveredException, while I use only one node

**URL:** https://discuss.elastic.co/t/getting-org-elasticsearch-discovery-masternotdiscoveredexception-while-i-use-only-one-node/248662
**Category:** Elasticsearch
**Created:** [September 15, 2020, 11:04am UTC](https://discuss.elastic.co/t/getting-org-elasticsearch-discovery-masternotdiscoveredexception-while-i-use-only-one-node/248662 "2020-09-15T11:04:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![111320](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111320/32/66612_2.png) [@111320](https://discuss.elastic.co/u/111320)
#### Post date: [September 15, 2020, 11:04am UTC](https://discuss.elastic.co/t/getting-org-elasticsearch-discovery-masternotdiscoveredexception-while-i-use-only-one-node/248662/1 "2020-09-15T11:04:46Z")

</div>

I'm running elasticsearch (7.6.2) on RHEL 6.1 with only one node and I get:

```
org.elasticsearch.discovery.MasterNotDiscoveredException

```

org.elasticsearch.discovery.MasterNotDiscoveredException  
This is my elasticsearch.yml:

```
> cluster.name: es-prod01
> node.name: node-1
> 
> node.max_local_storage_nodes: 1
> 
> path.data: /data/disk05,/data/disk06
> 
> path.logs: /var/log/elasticsearch
> 
> bootstrap.memory_lock: true

```

From all I read, it seems the configuration is good but I can't overcome this error.  
Any ideas?

---

<div class="post-metadata">

### Author: ![111320](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111320/32/66612_2.png) [@111320](https://discuss.elastic.co/u/111320)
#### Post date: [September 16, 2020, 10:05am UTC](https://discuss.elastic.co/t/getting-org-elasticsearch-discovery-masternotdiscoveredexception-while-i-use-only-one-node/248662/2 "2020-09-16T10:05:15Z")

</div>

From elasticsearch [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html)

> "If you don’t configure this setting, then the node has the following roles by default: `master` , `data` , `ingest` , `ml`"  
> Since I have only one node, and I didn't define node.roles I think the error "MasterNotDiscoveredException" should never raised.

How can it possible that elasticsearch instance don't find itself?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 17, 2020, 12:09am UTC](https://discuss.elastic.co/t/getting-org-elasticsearch-discovery-masternotdiscoveredexception-while-i-use-only-one-node/248662/3 "2020-09-17T00:09:53Z")

</div>

Take a look at [https://www.elastic.co/guide/en/elasticsearch/reference/7.6/discovery-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/discovery-settings.html)

---

<div class="post-metadata">

### Author: ![111320](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111320/32/66612_2.png) [@111320](https://discuss.elastic.co/u/111320)
#### Post date: [September 17, 2020, 6:19am UTC](https://discuss.elastic.co/t/getting-org-elasticsearch-discovery-masternotdiscoveredexception-while-i-use-only-one-node/248662/4 "2020-09-17T06:19:26Z")

</div>

Thanks Mark.  
I will describe what happen to my system maybe it will help others.  
I has a system with 5 nodes. In some point I was asked to use only one node since this system wasn't in real use. So I moved all indices to one node and use it. All was good in the beginning but when I tried to save some visualizations and search I get errors. After investigation I found this discussion [Getting "master not discovered or elected yet" causing cluster not up in version 7.1.0](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-causing-cluster-not-up-in-version-7-1-0/182489/20) and I saw David's answer about the problem that can be if some nodes were dropped from the system. I deleted all my data from `path.data` but I still had the same issue. After your answer I read [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-discovery-bootstrap-cluster.html) that in the first time we bootstrap a cluster we must define `cluster.initial_master_nodes` so I did it and now it looks good.  
Thanks

---

<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: [October 15, 2020, 6:19am UTC](https://discuss.elastic.co/t/getting-org-elasticsearch-discovery-masternotdiscoveredexception-while-i-use-only-one-node/248662/5 "2020-10-15T06:19:39Z")

</div>

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