1

我开始使用 Elasticsearch 2.0。当我想在一个集群上使用多个节点时,它似乎不起作用。

我尝试了两种不同的方法来创建多节点。

首先,我使用本地主机并创建了两个 Elasticsearch 实例。

其次,我为这个多节点使用了两台不同的计算机(我的本地计算机上的一个实例和服务器中的一个实例,我用来discovery.zen.ping.unicast.hosts绑定它们)。

它不同于 Elasticsearch 1.x 版本。我读到多播已经被删除。那么如何在 Elasticsearch 2.0 中为集群上的多节点设置配置文件?

这是我对不同服务器的配置设置

cluster.name: "cluster_node_1"
node.name: "test1_node1_ES2"
http.cors.enabled: true
index.number_of_shards: 5
index.number_of_replicas: 1
transport.tcp.port: 9300
http.port: 9200
http.cors.enable: true
network.bind_host: 10.21.126.151
network.publish_host: 10.21.126.151
network.host: 10.21.126.151
discovery.zen.ping.timeout: 3s
discovery.zen.ping.unicast.hosts: ["10.21.126.151", "10.21.126.145"]

谢谢

4

2 回答 2

1

我曾经遇到过同样的问题。解决方法是,

discovery.zen.ping.unicast.hosts 应该指向主节点。从您的问题来看,不清楚哪些节点是主节点、数据节点、客户端节点等。

可以说,10.21.126.151 是您的主节点,其余节点是数据节点。在所有节点中尝试以下配置

discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["10.21.126.151","[::1]"]

node.master=true will set as master node
node.master=false and node.data=true will make a nodes as data node
node.client=true will make a node as client and a client code can neither be server not be data node
于 2015-11-16T18:23:39.903 回答
0

我已经找到了答案。我需要在我的配置文件中为集群中的“其他”节点添加端口。所以在我的 10.21.126.151 配置文件中需要添加这个:discovery.zen.ping.unicast.hosts: ["10.21.126.145:9200"]

于 2015-11-17T05:59:10.350 回答