Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

master_not_discovered_exception ElasticSearch single node

I am trying to setup elasticsearch on a single host. Here is how my configuration looks like:

elasticsearch.yml

node.name: ${HOSTNAME}

network.host: _site_, _local_
http.port: 9200
transport.tcp.port: 9300
cluster.name: "test_cluster"
node.local: true

kibana.yml

server.host: 0.0.0.0
elasticsearch.url: http://localhost:9200

On following command:

curl -XGET 'localhost:9200/_cluster/health?pretty'

I get following message:

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

In log file I see following message:

not enough master nodes discovered during pinging (found [[]], but needed [-1]), pinging again

Could someone please point me right direction here?

like image 963
test123 Avatar asked Jul 22 '17 18:07

test123


People also ask

How many master nodes should I have Elasticsearch?

However, for any other use, you need at least a minimum of 3 master nodes in order to avoid any split-brain situation. This is a terrible situation to be in; it can result in an unhealthy cluster with many issues. This setting should always be configured to a quorum (majority) of your master-eligible nodes.

What is discovery seed hosts in Elasticsearch?

In short discovery. seed_hosts is the list of master nodes a new node uses to join the cluster, and cluster. initial_master_nodes is the initial list to bootstrap a cluster.

What is Discovery Zen Ping Unicast hosts?

unicast. hosts. This setting defines a static list of hosts for use as seed nodes for Zen discovery. These hosts can be specified as hostnames or IP addresses; hosts specified as hostnames are resolved to IP addresses during each round of pinging. Each value should be in the form of host:port or host .

What is network host in Elasticsearch Yml?

The network. host config is used to tell elasticsearch which IP in the server it will use to bind. Every service running in a server needs to bind to at least one IP, since servers can have multiple IPs, you can use 0.0. 0.0 to tell the service to bind to all the IPs available on the server.


1 Answers

I spent days (sigh) on basically this. I was trying to upgrade my single node cluster from 6.x es to 7.x, and I kept dying on the hill of "master_not_discovered_exception".

What finally solved it for me was examining a completely fresh install of 7.x.

For my single-node cluster, my /etc/elasticsearch/elasticsearch.yml needed the line:

discovery.type: single-node

I hope that saves someone else from spending days like I did. In my defence, I'm very new to es.

like image 197
James T Snell Avatar answered Sep 19 '22 18:09

James T Snell