Elasticsearch 集群 - 没有已知的主节点,安排重试

Elasticsearch Cluster - No known master node, scheduling a retry

我有一个服务器 运行 elasticsearch 和 kibana。我添加了第二个节点以形成集群,但只希望第二个节点从主节点复制数据。

根据有关如何执行此操作的有限文档,我 运行 第二次遇到以下错误

[DEBUG][action.admin.indices.get ] [Match] no known master node, scheduling a retry

我无法确定实现此目的的两台服务器的最佳配置,但这是我目前所做的:

主节点配置:

cluster.name: elasticsearch
node.master: true
path.data: /local00/elasticsearch/
path.work: /local00/el_temp/
network.host: 0.0.0.0
http.port: 9200
script.disable_dynamic: true

节点 2

cluster.name: elasticsearch
node.master: false
node.data: true
index.number_of_shards: 5
index.number_of_replicas: 1
path.data: /local00/elasticsearch/
path.work: /local00/el_temp/
network.host: 0.0.0.0
http.port: 9200
script.disable_dynamic: true

我假设我在某处缺少其他配置。任何帮助将不胜感激。

在此处回答了以下更改后得到了它的工作How to set up ES cluster?

节点 1:

cluster.name: mycluster
node.name: "node1"
node.master: true
node.data: true
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["node1.example.com"]

节点 2:

cluster.name: mycluster
node.name: "node2"
node.master: false
node.data: true
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["node1.example.com"]

如果您尝试将其他节点连接到已存在的 ES 集群,请确保此节点也具有与其他节点相同的所有 ES 插件。如果不是 - 节点无法完全连接(其他节点可以将其显示为已连接但无法在其上启动 http 命令)到 ES 集群,并出现如下错误:

[2016-07-21 11:56:59,564][DEBUG][action.admin.cluster.health] [dev-marvel1] no known master node, scheduling a retry
[2016-07-21 11:57:05,313][INFO ][rest.suppressed          ] /_cluster/health Params: {pretty=true}
MasterNotDiscoveredException[waited for [30s]]
        at org.elasticsearch.action.support.master.TransportMasterNodeAction.onTimeout(TransportMasterNodeAction.java:154)
        at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:239)
        at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:574)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

在我的案例中,问题出在许可证插件上。删除后一切正常。

如果您正在搜索此内容是因为您正在本地计算机上工作,那么最快的解决方案是通过单独终止所有进程来释放挂起的节点。我使用

搜索了这些进程
ps -alx | grep elastic
kill -9 {pid}