master_not_discovered_exception ElasticSearch 单节点

tes*_*123 6 elasticsearch kibana

我正在尝试在单个主机上设置 elasticsearch。这是我的配置的样子:

弹性搜索.yml

node.name: ${HOSTNAME}

network.host: _site_, _local_
http.port: 9200
transport.tcp.port: 9300
cluster.name: "test_cluster"
node.local: true
Run Code Online (Sandbox Code Playgroud)

kibana.yml

server.host: 0.0.0.0
elasticsearch.url: http://localhost:9200
Run Code Online (Sandbox Code Playgroud)

在以下命令中:

curl -XGET 'localhost:9200/_cluster/health?pretty'
Run Code Online (Sandbox Code Playgroud)

我收到以下消息:

{
  "error" : {
  "root_cause" : [
   {
      "type" : "master_not_discovered_exception",
      "reason" : null
   }
  ],
  "type" : "master_not_discovered_exception",
  "reason" : null
},
 "status" : 503
}
Run Code Online (Sandbox Code Playgroud)

在日志文件中,我看到以下消息:

not enough master nodes discovered during pinging (found [[]], but needed [-1]), pinging again
Run Code Online (Sandbox Code Playgroud)

有人可以在这里指出我正确的方向吗?

Jam*_*ell 21

我花了几天(叹气)基本上这个。我试图将我的单节点集群从 6.x 升级到 7.x,我一直在“master_not_discovered_exception”的山上死去。

最终为我解决的是检查全新安装的 7.x。

对于我的单节点集群,我的/etc/elasticsearch/elasticsearch.yml需要以下行:

discovery.type: single-node
Run Code Online (Sandbox Code Playgroud)

我希望这能让其他人免于像我一样度过几天。在我的辩护中,我对 es 很陌生。


小智 0

First I dont think you need network.host setting for this.

In your log it is trying to get a master, but result is 0

Can you try setting properties like:

node.master: true
node.data:true
Run Code Online (Sandbox Code Playgroud)

Also can you please put more logs here, if it doesnt work