我使用的是ElasticSearch和spring数据搜索,我在一个ec2示例中配置了ElasticSearch,所以最初我把网络主机设置为0.0.0.0,但是后来我把它绑定到网络主机上,网络主机是示例的私有ip,从中我得到了这个错误。尽管如果我卷一卷http://pvtip:9200工作正常http://pvtip:9200/nodes仅将传输层作为专用ip返回给我,但它仍然不起作用。我检查了在我的代码所在的ElasticBeanstalk示例中,是否配置了任何类型的elastic搜索,但它不存在
还要注意的是,这个错误只在我将代码移动到服务器时触发,甚至在jenkins构建作业的过程中也会触发
我做到了: sudo service elasticsearch status
它甚至不能识别ElasticSearch sudo netstat -ntlp
不返回为9200和9300打开的端口
完整堆栈跟踪如下:
2020-09-11 12:34:04.941 WARN 25875 --- [ient_boss][T#2]] o.e.transport.netty4.Netty4Transport : exception caught on transport layer [NettyTcpChannel{localAddress=/<private-ip-beanstalk>:40554, remoteAddress=/<private-ip-ec2-where-elasticsearch-is-hosted>:9300}], closing connection
java.io.IOException: Invalid string; unexpected character: 180 hex: b4
at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:402) ~[elasticsearch-6.4.3.jar!/:6.4.3]
at org.elasticsearch.common.io.stream.StreamInput.readCollection(StreamInput.java:959) ~[elasticsearch-6.4.3.jar!/:6.4.3]
at org.elasticsearch.common.io.stream.StreamInput.readList(StreamInput.java:941) ~[elasticsearch-6.4.3.jar!/:6.4.3]
at org.elasticsearch.common.io.stream.StreamInput.readMapOfLists(StreamInput.java:511) ~[elasticsearch-6.4.3.jar!/:6.4.3]
at org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.<init>(ThreadContext.java:380) ~[elasticsearch-6.4.3.jar!/:6.4.3]
at org.elasticsearch.common.util.concurrent.ThreadContext$ThreadContextStruct.<init>(ThreadContext.java:366) ~[elasticsearch-6.4.3.jar!/:6.4.3]
at org.elasticsearch.common.util.concurrent.ThreadContext.readHeaders(ThreadContext.java:200) ~[elasticsearch-6.4.3.jar!/:6.4.3]
at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1424) ~[elasticsearch-6.4.3.jar!/:6.4.3]
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:64) ~[transport-netty4-client-6.4.3.jar!/:6.4.3]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) [netty-codec-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:311) [netty-codec-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:425) [netty-codec-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) [netty-codec-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271) [netty-handler-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:615) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:578) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [netty-transport-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-common-4.1.50.Final.jar!/:4.1.50.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.50.Final.jar!/:4.1.50.Final]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_252]
暂无答案!
目前还没有任何答案,快来回答吧!