I'm Getting Master Not Discovered Exception On Remote Server

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.

Any help would be appreciated.

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

1 Like

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.

1 Like

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.

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

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

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

Regards,

Jurgen

1 Like

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

Jurgen

1 Like

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

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