janusgraph 常见问题
1. 提示字符串无法转为Map
这是remote方式访问遇到的问题,需要将remote.yaml配置文件中的序列化配置serializeResultToString
改为false
2. org.apache.tinkerpop.gremlin.driver.ser.SerializationException: org.apache.tinkerpop.shaded.kryo.KryoException: Encountered unregistered class ID: 65536
这是remote方式访问遇到的问题,需要在remote.yaml配置文件中加入序列化类配置,custom: [org.janusgraph.graphdb.relations.RelationIdentifier]
这是一种指定类型的解决方式,janusgraph driver已经提供通用的方式,IoRegistry
,只需要在配置中添加配置
serializer: className:
org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 config: serializeResultToString: false #custom: [org.janusgraph.graphdb.relations.RelationIdentifier] ioRegistries:
[org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry]
参考解释
The IoRegistry tells the serializer what classes from the graph provider to auto-register during serialization. Gremlin Server roughly uses this same approach when it configures its serializers.
参考文献
3. cypher for gremlin驱动只能使用websocket连接janusgraph server
cypher for gremlin 没有支持rest的方式,如果要使用http协议部署janusgraph,并且想使用cypher语法,那就是只能在客户端转换cypher语法,然后将gremlin语句通过rest的方式调用janusgraph server