我怎样才能建立ES集群?

时间:2014-06-03 18:44:26

标签: elasticsearch

我有一个主节点,ip为192.168.1.101,非主节点,ip为192.168.1.106。两者使用相同版本的ElasticSearch-1.2.0。

但是在我启动主节点和非主节点之后,我得到了以下信息:

  

[2014-06-04 02:38:49,350] [INFO] [discovery.zen] [node2]无法向master [[node1] [TxZ5wuhnT1awPC1gEjYPdw]发送加入请求[flyers-MacBook-Air.local] [ inet [/192.168.1.101:9300]] {master = true}],reason [org.elasticsearch.ElasticsearchTimeoutException:超时等待任务。]

主节点的配置:

  

cluster.name:mycluster
  node.name:" node1"
  node.master:true
  node.data:true
  index.number_of_shards:5
  index.number_of_replicas:1
  discovery.zen.ping.multicast.enabled:false
  discovery.zen.ping.unicast.hosts:[" 192.168.1.101"]

非主节点的配置:

  

cluster.name:mycluster
  node.name:" node2"
  node.master:false
  node.data:true
  index.number_of_shards:5
  index.number_of_replicas:1
  discovery.zen.ping.multicast.enabled:false
  discovery.zen.ping.unicast.hosts:[" 192.168.1.101"]

我不知道为什么会发生这种异常。请给我一些提示。提前谢谢。

3 个答案:

答案 0 :(得分:3)

network.bind_host network.publish_host network.host 设置为该节点所持有的IP后,它就可以了。很奇怪。

答案 1 :(得分:1)

我遇到了同样的问题,直到我发现我的ES节点没有按预期绑定到eth0而是直接绑定到eth2。当然这不起作用,因为来自主节点的注册响应无法发送到我的其他网络的IP地址。 我能够通过在elasticsearch.yml中设置以下参数来修复此行为(在无法加入群集的服务器上)

network.publish_host: "_eth0:ipv4_"

答案 2 :(得分:0)

我最好在两种配置中将["192.168.1.101"]更改为["192.168.1.101", "192.168.1.106"]

相关问题