'"master_not_discovered_exception" when trying to configure Elastic Search 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:
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
{"error":{"root_cause":[{"type":"master_not_discovered_exception","reason":null}],"type":"master_not_discovered_exception","reason":null},"status":503}
Any help would be appreciated.
Solution 1:[1]
From ES-7 onwards add the below config in the .yml file
cluster.initial_master_nodes : <IP_or_DNS_of_master_node>
Solution 2:[2]
From ES7, it worked for me:
sudo nano /etc/elasticsearch/elasticsearch.ymlUncomment the
node.namelineChange
network.hostto0.0.0.0,discovery.seed.hoststo[“127.0.0.1”], andcluster.initial_master_nodesto[“node-1”]When done, quit nano, then type
:ctrl-x,typeyessudo /bin/systemctl daemon-reloadsudo /bin/systemctl enable elasticsearch.servicesudo /bin/systemctl restart elasticsearch.service
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nithin Veer Reddy Kankanti |
| Solution 2 | DuDa |
