# I'm Getting Master Not Discovered Exception On Remote Server

**URL:** https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508
**Category:** Elasticsearch
**Created:** [July 2, 2019, 12:15pm UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508 "2019-07-02T12:15:18Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![emrealtan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emrealtan/32/49268_2.png) [@emrealtan](https://discuss.elastic.co/u/emrealtan)
#### Post date: [July 2, 2019, 12:15pm UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508/1 "2019-07-02T12:15:18Z")

</div>

I'm trying to configure Elastic Search on one of our remote servers. I've installed it with .msi setup file (v7.1.1) and configured the firewall for 9200 and 9300 ports.

When I set `network.publish_host` to server ip it gave me this error `the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured`. Then I've made some research and set `cluster.initial_master_nodes` to my single node which named "ElasticSearchNode". Now the service is running but when i check the cluster health it says "master\_not\_discovered\_exception".

My current yml file looks like:

`yml bootstrap.memory_lock: false cluster.name: elasticsearch http.port: 9200 node.data: true node.ingest: true node.master: true node.max_local_storage_nodes: 1 node.name: ElasticSearchNode path.data: C:\ProgramData\Elastic\Elasticsearch\data path.logs: C:\ProgramData\Elastic\Elasticsearch\logs transport.tcp.port: 9300 xpack.license.self_generated.type: basic xpack.security.enabled: false network.host: 0.0.0.0 network.publish_host: x.x.x.x cluster.initial_master_nodes: ElasticSearchNode discovery.zen.minimum_master_nodes: 1`

The response when i requested /\_cat/health?v

`json {"error":{"root_cause":[{"type":"master_not_discovered_exception","reason":null}],"type":"master_not_discovered_exception","reason":null},"status":503}`

Log file is [here](https://yadi.sk/d/wKRHf3tT5iSwRw).

Any help would be appreciated.

---

<div class="post-metadata">

### Author: ![Jurgen\_Debedts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jurgen_debedts/32/49335_2.png) [@Jurgen\_Debedts](https://discuss.elastic.co/u/Jurgen_Debedts)
#### Post date: [July 3, 2019, 9:23am UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508/2 "2019-07-03T09:23:53Z")

</div>

Hello,

Struggled with cluster connection problems somewhat as well. Below are the relevant pieces of my yml file.  
I believe one of the mistakes may be that you do not have node.master in your yml file.  
In this, servername1 and servername2 should be replaced by the correct dns name of your servers.

```
cluster.name: elastic
node.name: ElasticNode1
node.master: true
node.data: true
network.host: Servername1
network.bind_host: Servername1
http.port: 9200
discovery.seed_hosts: ["Servername1", "Servername2"]
cluster.initial_master_nodes: ["ElasticNode1", "ElasticNode2"]

```

Jurgen

---

<div class="post-metadata">

### Author: ![Jurgen\_Debedts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jurgen_debedts/32/49335_2.png) [@Jurgen\_Debedts](https://discuss.elastic.co/u/Jurgen_Debedts)
#### Post date: [July 3, 2019, 9:40am UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508/3 "2019-07-03T09:40:28Z")

</div>

Note that you will need to edit the yml files of all your nodes in the cluster.  
As a general rule for a 2 node cluster, set both node up as data and master node.

---

<div class="post-metadata">

### Author: ![emrealtan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emrealtan/32/49268_2.png) [@emrealtan](https://discuss.elastic.co/u/emrealtan)
#### Post date: [July 4, 2019, 7:59am UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508/4 "2019-07-04T07:59:45Z")

</div>

Hi and thanks for help. Actually I have only one server for elasticsearch. I've changed my yml file according to your suggestion but I'm still getting the same warning which says:

`[2019-07-04T10:57:36,163][WARN][o.e.c.c.ClusterFormationFailureHelper] [ElasticNode1] master not discovered or elected yet, an election requires a node with id [Q7UjKuM3QimcL4pCKmUB6w], have discovered [] which is not a quorum; discovery will continue using [] from hosts providers and [{ElasticNode1}{S1tdE5hQTCeXwElJUyqBXw}{zvSpL_10ThCs9VWcwFJc0w}{x.x.x.x}{x.x.x.x:9300}{ml.machine_memory=17179398144, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 1, last-accepted version 14 in term 1`

My yml file looks like:

```
bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.name: ElasticNode1
path.data: C:\ProgramData\Elastic\Elasticsearch\data
path.logs: C:\ProgramData\Elastic\Elasticsearch\logs
transport.tcp.port: 9300
xpack.license.self_generated.type: basic
xpack.security.enabled: false
network.host: 0.0.0.0
network.bind_host: x.x.x.x
discovery.seed_hosts: ["x.x.x.x"]
cluster.initial_master_nodes: ["ElasticNode1"]

```

Do you have any idea or suggestion?

Thanks again.

---

<div class="post-metadata">

### Author: ![Jurgen\_Debedts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jurgen_debedts/32/49335_2.png) [@Jurgen\_Debedts](https://discuss.elastic.co/u/Jurgen_Debedts)
#### Post date: [July 8, 2019, 6:27pm UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508/5 "2019-07-08T18:27:14Z")

</div>

Hello,  
Do you have a specific reason to create a cluster when you only have 1 node?  
I never tried a single node cluster to be honest.  
Other than that, could you give it a try to have the same setting for network.host and network.bind-host and make sure it is the same as the seed\_hosts.

Sometimes it also makes sense to clean out the data directory. I has happened to me that some cluster info in there was not correct after changing the cluster config, and cleaning the data dir re-executes the registrations and that has helped me on at least 1 occasion.

Regards,

Jurgen

---

<div class="post-metadata">

### Author: ![Jurgen\_Debedts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jurgen_debedts/32/49335_2.png) [@Jurgen\_Debedts](https://discuss.elastic.co/u/Jurgen_Debedts)
#### Post date: [July 8, 2019, 6:32pm UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508/6 "2019-07-08T18:32:34Z")

</div>

There is actually some info in here as well that seems to correspond to your issue.

> [@2 node cluster on Elasticsearch 7.0.1](https://discuss.elastic.co/t/2-node-cluster-on-elasticsearch-7-0-1/189127):
>
> Hi We had configured a 2 node cluster on Elasticsearch 6.x with both nodes configured as master eligible and the minimum number of master nodes configured to 1. We found this worked for our requirements particularly where if either node was temporarily removed from the cluster (if it is being upgraded or when simulating a node failure) the other node was automatically elected as the master. Following an upgrade to Elasticsearch 7.0.1 we find that this is no longer the case, when the currently…

I would seriously consider not to configure your installation as a cluster is you are going to have only 1 single node.

Regards,

Jurgen

---

<div class="post-metadata">

### Author: ![Jurgen\_Debedts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jurgen_debedts/32/49335_2.png) [@Jurgen\_Debedts](https://discuss.elastic.co/u/Jurgen_Debedts)
#### Post date: [July 8, 2019, 6:42pm UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508/7 "2019-07-08T18:42:24Z")

</div>

Hello,

Further to the subject of the clearing of the data directory see this document:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#modules-discovery-bootstrap-cluster-joining](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#modules-discovery-bootstrap-cluster-joining)

Jurgen

---

<div class="post-metadata">

### Author: ![emrealtan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emrealtan/32/49268_2.png) [@emrealtan](https://discuss.elastic.co/u/emrealtan)
#### Post date: [July 9, 2019, 7:08am UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508/8 "2019-07-09T07:08:18Z")

</div>

Hello Jurgen,

As you said, clearing the data has solved my problem. Thanks for helping!

I've removed the cluster setup from config file by the way. I've set single-node only. My config file looks like:

`transport.host: x.x.x.x`  
`transport.tcp.port: 9300`  
`http.port: 9200`  
`network.host: x.x.x.x`  
`discovery.type: single-node`

---

<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: [August 6, 2019, 7:08am UTC](https://discuss.elastic.co/t/im-getting-master-not-discovered-exception-on-remote-server/188508/9 "2019-08-06T07:08:19Z")

</div>

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