无法在Windows上使用单播启动两个ElasticSearch节点

时间:2013-10-11 22:22:27

标签: elasticsearch

我试图在Windows上启动两个ElasticSearch节点。如果我使用多播,则节点会正常启动。但是,我在尝试使用单播时遇到异常。

我的设置是:

cluster.name: mycluster
name.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: ["node2:9200"]

cluster.name: mycluster
name.name: NODE2
node.master: false # tried true as well
node.data: true
index.number_of_shards: 5
index.number_of_replicas: 1
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["node1:9200"]

我可以在node1上成功启动ES但是当我尝试在node2上启动ES时,我在node1中得到以下异常:

[2013-10-11 15:04:02,307][WARN ][http.netty               ] [NODE1] Caught exception while handling client http traffic, closing connection [id: 0x4061b93e, /10.241.2.96:58768 :> /10.241.1.70:9200]
java.lang.IllegalArgumentException: empty text
at org.elasticsearch.common.netty.handler.codec.http.HttpVersion.<init>(HttpVersion.java:97)
  at org.elasticsearch.common.netty.handler.codec.http.HttpVersion.valueOf(HttpVersion.java:62)
  at org.elasticsearch.common.netty.handler.codec.http.HttpRequestDecoder.createMessage(HttpRequestDecoder.java:75)
  at org.elasticsearch.common.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:189)
  at org.elasticsearch.common.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:101)
  at org.elasticsearch.common.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:500)
  at org.elasticsearch.common.netty.handler.codec.replay.ReplayingDecoder.cleanup(ReplayingDecoder.java:554)
  at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.channelDisconnected(FrameDecoder.java:365)
  at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:102)
  at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
  at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
  at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:74)
  at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
  at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
...

我的环境:

Elastic Search Version on both node1 and node2: 0.90.3
Java version: 
    java version "1.7.0"
    Java(TM) SE Runtime Environment (build 1.7.0-b147)
    Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

有什么想法在这里发生了什么?

谢谢, 埃里克

2 个答案:

答案 0 :(得分:4)

9200是数据端口

单播发现从控制端口9300发生......

http://people.mozilla.org/~wkahngreene/elastic/guide/reference/modules/transport.html

答案 1 :(得分:3)

我犯的错误是将其他节点的端口设置为9200.我不是这方面的专家(正如您可以通过我的问题所说)但我认为9200是客户端用来与之交互的端口搜索引擎;但是其他ES实例默认使用不同的端口(可能是9300)。通过改变:

discovery.zen.ping.unicast.hosts: ["node1:9200"]

为:

discovery.zen.ping.unicast.hosts: ["node1"]
事情对我来说很好。