询问端口9300时ElasticSearch 0.90.2 StreamCorruptedException

时间:2013-07-25 10:04:23

标签: exception configuration elasticsearch

我刚刚在Windows XP上解压缩了elasticsearch-0.90.2.zip,并启动了bin / elasticsearch.bat。

我已将JAVA_HOME设置为C:\ Program Files \ Java \ jre7,因为它在首次运行时出现问题。

我正在尝试通过Google Chrome 27.0.1453.116连接它。

根据elasticsearch.yml,“默认情况下,ElasticSearch将自身绑定到0.0.0.0地址”,但0.0.0.0:9200响应108(net :: ERR_ADDRESS_INVALID)。

localhost:9200或127.0.0.1:9200响应正确:{“ok”:true等等。

localhost:9300响应324(net :: ERR_EMPTY_RESPONSE),并在控制台窗口中显示StreamCorruptedException:

[2013-07-25 10:42:30,419][WARN ][transport.netty          ] [Happy Birthday] exc
eption caught on transport layer [[id: 0x478ae9b7, /127.0.0.1:1627 => /127.0.0.1
:9300]], closing connection
java.io.StreamCorruptedException: invalid internal transport message format
        at org.elasticsearch.transport.netty.SizeHeaderFrameDecoder.decode(SizeH
eaderFrameDecoder.java:27)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callD
ecode(FrameDecoder.java:425)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messa
geReceived(FrameDecoder.java:303)
        at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.h
andleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$Default
ChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(Ope
nChannelsHandler.java:74)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:559)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(C
hannels.java:268)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(C
hannels.java:255)
        at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioW
orker.java:88)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.p
rocess(AbstractNioWorker.java:109)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector
.run(AbstractNioSelector.java:312)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.r
un(AbstractNioWorker.java:90)
        at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWo
rker.java:178)
        at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(Thread
RenamingRunnable.java:108)
        at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.ru
n(DeadLockProofWorker.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
[2013-07-25 10:42:30,435][WARN ][transport.netty          ] [Happy Birthday] exc
eption caught on transport layer [[id: 0x478ae9b7, /127.0.0.1:1627 :> /127.0.0.1
:9300]], closing connection
java.io.StreamCorruptedException: invalid internal transport message format
        at org.elasticsearch.transport.netty.SizeHeaderFrameDecoder.decode(SizeH
eaderFrameDecoder.java:27)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callD
ecode(FrameDecoder.java:425)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.clean
up(FrameDecoder.java:482)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.chann
elDisconnected(FrameDecoder.java:365)
        at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.h
andleUpstream(SimpleChannelUpstreamHandler.java:102)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$Default
ChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(Ope
nChannelsHandler.java:74)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:559)
        at org.elasticsearch.common.netty.channel.Channels.fireChannelDisconnect
ed(Channels.java:396)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.c
lose(AbstractNioWorker.java:361)
        at org.elasticsearch.common.netty.channel.socket.nio.NioServerSocketPipe
lineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:81)
        at org.elasticsearch.common.netty.channel.socket.nio.NioServerSocketPipe
lineSink.eventSunk(NioServerSocketPipelineSink.java:36)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDow
nstream(DefaultChannelPipeline.java:574)
        at org.elasticsearch.common.netty.channel.Channels.close(Channels.java:8
12)
        at org.elasticsearch.common.netty.channel.AbstractChannel.close(Abstract
Channel.java:197)
        at org.elasticsearch.transport.netty.NettyTransport.exceptionCaught(Nett
yTransport.java:505)
        at org.elasticsearch.transport.netty.MessageChannelHandler.exceptionCaug
ht(MessageChannelHandler.java:224)
        at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.h
andleUpstream(SimpleChannelUpstreamHandler.java:112)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$Default
ChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.excep
tionCaught(FrameDecoder.java:377)
        at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.h
andleUpstream(SimpleChannelUpstreamHandler.java:112)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$Default
ChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(Ope
nChannelsHandler.java:74)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:559)
        at org.elasticsearch.common.netty.channel.Channels.fireExceptionCaught(C
hannels.java:525)
        at org.elasticsearch.common.netty.channel.AbstractChannelSink.exceptionC
aught(AbstractChannelSink.java:48)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.notifyH
andlerException(DefaultChannelPipeline.java:658)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:566)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$Default
ChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(Ope
nChannelsHandler.java:74)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUps
tream(DefaultChannelPipeline.java:559)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(C
hannels.java:268)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(C
hannels.java:255)
        at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioW
orker.java:88)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.p
rocess(AbstractNioWorker.java:109)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector
.run(AbstractNioSelector.java:312)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.r
un(AbstractNioWorker.java:90)
        at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWo
rker.java:178)
        at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(Thread
RenamingRunnable.java:108)
        at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.ru
n(DeadLockProofWorker.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

我已经读过类似的情况,但现在没有其他节点在运行,没有网络,没有使用该端口,它是我在默认配置的本地计算机上的第一个独立的ElasticSearch引擎。

我无法想象1627号港口应该有什么 - 也许是线索。 我错了什么 - 或任何解决方案?

2 个答案:

答案 0 :(得分:13)

没有任何损坏。 9300端口用于节点间通信并使用内部二进制协议,因此您无法从浏览器中使用它。为了使用9300端口,您必须使用节点客户端或传输客户端Java API,它们都了解内部二进制协议。

在浏览器中,您应该只使用9200端口,这是暴露REST API的端口。

答案 1 :(得分:0)

我遇到了同样的问题。正如我发现问题是在configs内部(默认情况下为/etc/elasticsearch/elasticsearch.yml)。有一个棘手的参数http.enabled默认设置为false。要修复,您只需将其设置为true

http.port: 9200 http.enabled: true

我希望它会有所帮助。