Elasticsearch Tribe 节点和 Kibana - 没有已知的主节点

Elasticsearch Tribe Node and Kibana - no known master node

我正在使用 Elasticsearch 2.3.1 和 Kibana 4.5。我有 2 个弹性搜索集群。

集群 1 - 1 个主节点、1 个数据节点和 1 个客户端节点。 集群 2 - 1 个主节点、1 个数据节点和 1 个部落节点。

部落节点能够与两个集群中的节点通信。我在两个集群中也有 2 个索引,集群 1 中的 cluster1index 和集群 2 中的 cluster2index。我能够查看索引:

yellow open cluster2index 5 1  22400 0  24.6mb  24.6mb 
yellow open cluster1index 5 1 129114 0 109.9mb 109.9mb 

但是,如果我尝试将 Kibana 连接到 tribe 节点,我会收到错误

[2016-05-05 11:49:03,162][DEBUG][action.admin.indices.create] [tribe-node-MS2] no known master node, scheduling a retry
[2016-05-05 11:49:33,163][DEBUG][action.admin.indices.create] [tribe-node-MS2] timed out while retrying [indices:admin/create] after failure (timeout [30s])
[2016-05-05 11:49:33,165][WARN ][rest.suppressed          ] /.kibana Params: {index=.kibana}
MasterNotDiscoveredException[null]
    at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.onTimeout(TransportMasterNodeAction.java:226)
    at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:236)
    at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:804)
    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)

我尝试将 kibana 连接到客户端节点,并且能够查看我的索引。在此之后,如果我将 Kibana 连接到 tribe 节点,我就可以查看仪表板。

我的 kibana 配置:

 server.port: 5601
 server.host: "hostname"
 elasticsearch.url: "http://hostname:port"
 kibana.index: ".kibana"

我不确定为什么 Kibana 最初不使用部落节点以及我的配置中是否遗漏了任何内容。

我在 elasticsearch 论坛中阅读了其中一个答案:

"Regarding the issue you have with kibana, you can't create a .kibana index directly with the tribe node because it's a tribe node :slight_smile: sitting in a cluster that has no master node and data node. Yes, this tribe node is connected to two clusters in this case but it does not know where to put .kibana index if you are under the assumption that it should write to one of the clusters."

难道我一开始不能直接在tribe节点创建kibana索引,后来索引已经创建好了,就可以把kibana指向tribe节点了?如果可以,有没有什么配置可以直接连接Kibana和部落节点?

很好的附加信息,此外,您可以在 this github issue and, also, in this one.

中找到此行为的 确认信息

总结...

The Tribe Node documentation states that you cannot execute Master Level Write Operations such as Create Index, both of which are required when using Kibana 4 for the first time. Simply creating the index is not sufficient, because Put Mapping is also required, and is also a Master Level Write Operation.

As a workaround, first bring up the Kibana 4 instance and configure it to point directly at one of the remote clusters so that it will initialize the .kibana index in that cluster. While Kibana 4 is connected to this single cluster, create and save the Index Settings/Index Pattern that you will be using for the tribe node there, and create/save at least 1 visualization and 1 dashboard. Then update Kibana yml file to reconfigure its ES connection to point to the tribe node and restart Kibana 4.

From that point on, you should be able to continue managing Kibana Dashboards & Visualizations through the tribe node, providing that the .kibana index exists in only one of the remote clusters. If the index must exist in more than one cluster (e.g., you are doing snapshot/restore for redundancy), then instruct the Tribe node to prefer the master version with these settings (where clusterA holds the master .kibana index):

tribe:
  on_conflict: prefer_clusterA