elasticsearch在专用服务器上的RemoteTransportException

时间:2015-01-13 05:55:35

标签: java exception elasticsearch

我正在尝试将elasticsearch与生产集成,但会遇到以下异常。 我在服务器1.7.0_40中使用的jvm

  

2015-01-12 21:29:06 DEBUG netty:94 - [Whitemane,Aelfyre]连接到   节点[[#transport#-1] [inet [/xxx.xxx.xx.xxx:9300]]] 2015-01-12 21:29:06   WARN netty:114 - [Whitemane,Aelfyre]消息未完全阅读   (响应)[63]处理程序   未来(org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler$1@4e70a141)   错误[true],重置2015-01-12 21:29:06 INFO transport:109 -   [Whitemane,Aelfyre]未能获得节点信息   [#transport#-1] [inet [/xxx.xxx.xx.xxx:9300]],断开连接...   org.elasticsearch.transport.RemoteTransportException:失败   从流中反序列化异常响应引起:   org.elasticsearch.transport.TransportSerializationException:失败   从流中反序列化异常响应   org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:171)     在   org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:125)     在   org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)     在   org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)     在   org.elasticsearch.common.netty.channel.DefaultChannelPipeline $ DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:787)     在   org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)     在   org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)     在   org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)     在   org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)     在   org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)     在   org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)     在   org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555)     在   org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)     在   org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)     在   org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)     在   org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)     在   org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)     在   org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)     在   org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)     在   org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)     在   org.elasticsearch.common.netty.util.internal.DeadLockProofWorker $ 1.run(DeadLockProofWorker.java:42)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:615)     在java.lang.Thread.run(Thread.java:724)引起:   java.io.InvalidClassException:无法读取类描述符   java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601)     在   java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)     在   java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)     在   java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)     在   java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)     在   java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)     在   java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)     在   java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)     在   java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)     在java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)     在   org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:169)     ... 23更多引起:java.lang.ClassNotFoundException:   org.elasticsearch.ElasticsearchException at   java.net.URLClassLoader $ 1.run(URLClassLoader.java:366)at   java.net.URLClassLoader $ 1.run(URLClassLoader.java:355)at   java.security.AccessController.doPrivileged(Native Method)at   java.net.URLClassLoader.findClass(URLClassLoader.java:354)at   java.lang.ClassLoader.loadClass(ClassLoader.java:424)at   sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:308)at at   java.lang.ClassLoader.loadClass(ClassLoader.java:357)at   org.elasticsearch.common.io.ThrowableObjectInputStream.loadClass(ThrowableObjectInputStream.java:93)     在   org.elasticsearch.common.io.ThrowableObjectInputStream.readClassDescriptor(ThrowableObjectInputStream.java:67)     在   java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1599)     ......还有34个

1 个答案:

答案 0 :(得分:0)

根据根异常java.lang.ClassNotFoundException: org.elasticsearch.ElasticsearchException以及您将Elasticsearch与(将elasticsearch与生产集成)的任何内容进行判断我猜测:

  • 您在“生产”系统的类路径中缺少elasticsearch.jar,或者您认为它在类路径中,但事实上,它不是
  • 您使用的是不同的Elasticsearch版本(服务器有一个版本,您的“生产”系统使用其他版本的ES jar

在Elasticsearch 0.20.5中,这是有问题的类:https://github.com/elasticsearch/elasticsearch/blob/v0.20.5/src/main/java/org/elasticsearch/ElasticSearchException.java。注意类的名称 - ElasticSearchException(大写字母“S”)。

在Elasticsearch 1.4.2中,类名称已更改:https://github.com/elasticsearch/elasticsearch/blob/v1.4.2/src/main/java/org/elasticsearch/ElasticsearchException.java。注意类的名称 - ElasticsearchException(小写“s”)。

因此,您确实需要在两台服务器上使用相同的Elasticsearch版本。