4

我正在尝试在 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)

有什么想法吗?

谢谢,埃里克

4

2 回答 2

4

9200是数据端口

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

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

于 2014-03-19T13:26:07.870 回答
3

我犯的错误是将其他节点的端口设置为 9200。我不是这方面的专家(正如你可以从我的问题中看出的那样),但我认为 9200 是客户端应该用来与搜索引擎交互的端口;但是其他 ES 实例默认使用不同的端口(可能是 9300)。通过改变:

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

至:

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

事情对我来说很好。

于 2013-10-14T22:52:32.737 回答