连接gremlin和gephi时出现问题

时间:2016-05-31 10:30:37

标签: gremlin

我正在尝试将远程服务器上的gremlin与gephi连接起来。 gremlin使用后端作为Titan-1.0.0中的cassandra。我还配置了连接到服务器

:remote connect tinkerpop.server conf/remote-objects.yaml
==>Connected - ip-10-125-10-127.eu-west-1.compute.internal/10.125.10.127:8182

但是当执行此操作时,

:> g

我收到以下错误:

10:13:41 WARN  org.apache.tinkerpop.gremlin.driver.MessageSerializer  - Response [PooledUnsafeDirectByteBuf(ridx: 136, widx: 136, cap: 136)] could not be deserialized by     org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0.
10:13:41 ERROR org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler  - Could not process the response - correct the problem and restart the driver.
io.netty.handler.codec.DecoderException: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.lang.IndexOutOfBoundsException: Index: 121, Size: 0
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at org.apache.tinkerpop.gremlin.driver.handler.WebSocketClientHandler.channelRead0(WebSocketClientHandler.java:90)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:182)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.lang.IndexOutOfBoundsException: Index: 121, Size: 0
    at org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0.deserializeResponse(GryoMessageSerializerV1d0.java:216)
    at org.apache.tinkerpop.gremlin.driver.handler.WebSocketGremlinResponseDecoder.decode(WebSocketGremlinResponseDecoder.java:49)
    at org.apache.tinkerpop.gremlin.driver.handler.WebSocketGremlinResponseDecoder.decode(WebSocketGremlinResponseDecoder.java:36)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
    ... 20 more
Caused by: java.lang.IndexOutOfBoundsException: Index: 121, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:653)
    at java.util.ArrayList.get(ArrayList.java:429)
    at org.apache.tinkerpop.shaded.kryo.util.MapReferenceResolver.getReadObject(MapReferenceResolver.java:60)
    at org.apache.tinkerpop.shaded.kryo.Kryo.readReferenceOrNull(Kryo.java:831)
    at org.apache.tinkerpop.shaded.kryo.Kryo.readObjectOrNull(Kryo.java:725)
    at org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0.deserializeResponse(GryoMessageSerializerV1d0.java:199)
    ... 23 more
Index: 121, Size: 0

在打开端口的webconsole 10.125.10.127:8182中,我得到了

not a WebSocket handshake request: missing upgrade

1 个答案:

答案 0 :(得分:2)

你混淆了一些东西。如果您的主要要求是连接到Titan以在Gephi中可视化图形,那么最简单的方法是在Titan Gremlin控制台中打开TitanGraph实例

graph = TitanFactory.open(...)

然后按照此处的说明操作:

http://tinkerpop.apache.org/docs/3.0.2-incubating/#gephi-plugin

您不希望与:remote连接到Gremlin Server,因为您需要本地Graph实例来使用Gephi。请注意,:remote未连接到HttpChannelizer - 用于REST基础通信,而:remote适用于需要WebSocketChannelizer的websockets。