2013-07-25 42 views
7

我剛剛在Windows XP上解壓縮elasticsearch-0.90.2.zip,並啓動bin/elasticsearch.bat。ElasticSearch 0.90.2詢問端口9300時出現StreamCorruptedException

我已經將JAVA_HOME設置爲C:\ Program Files \ Java \ jre7,因爲這是第一次運行時的問題。

我試圖從谷歌瀏覽器27.0.1453.116連接它。

根據elasticsearch.yml,「ElasticSearch,默認情況下,自身綁定到0.0.0.0地址」,但0.0.0.0:9200響應108(net :: ERR_ADDRESS_INVALID)。

本地主機:9200或127.0.0.1:9200正確響應:{ 「OK」:真等

本地主機:9300響應324(淨:: 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應該有什麼 - 也許這是線索。 我錯了什麼 - 或者任何解決方案?

+0

如果通過端口9200連接進行響應,那麼問題是什麼? – ramseykhalaf

+0

也許沒什麼,但我認爲有東西被損壞。 – user2618018

+0

我的答案是否爲您澄清了一些事情? – javanna

回答

13

沒有損壞。 9300端口用於節點間通信並使用內部二進制協議,因此不能在瀏覽器中使用它。爲了使用9300端口,您必須使用Java API,無論是節點客戶端還是傳輸客戶端,它們都瞭解內部二進制協議。

從瀏覽器中,您應該只使用9200端口,這是暴露REST API的端口。

0

我遇到了同樣的問題。正如我發現的問題是在配置裏(默認爲/etc/elasticsearch/elasticsearch.yml)。有一個棘手的參數http.enabled默認設置爲false。對於修復,你只需要把它設置爲true

http.port: 9200 http.enabled: true

我希望這將有助於。

相關問題