Janus Graph HBase和Solr未知外部索引后端:jgex

时间:2018-05-15 07:59:26

标签: solr gremlin janusgraph gremlin-server janus

我使用JanusGraph 0.2.0,Hbase 1.2.6和Solr 7.3.0。我想运行一个带有Hbase(存储后端)和Solr(索引后端)的独立Janus Graph服务器。然后使用gremlin驱动程序(使用Java Client)连接并使用Gremlin Query语言遍历我的图形。我在本地安装了Hbase和Solr。 我跟着说:

https://github.com/JanusGraph/janusgraph/tree/master/janusgraph-examples/example-remotegraph 

使用janusgraph-hbase-solr.properties更新了gremlin-server.yaml。 我成功启动了Gremlin服务器。我用

创建了核心jgex
  

solr create_core -d $ JANUSGRAPH_HOME / conf / solr -c jgex

还有gremlin-server.yaml

host: 0.0.0.0
port: 8182
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
  graph: conf/gremlin-server/janusgraph-hbase-solr.properties
}
plugins:
  - janusgraph.imports
scriptEngines: {
  gremlin-groovy: {
    imports: [java.lang.Math],
    staticImports: [java.lang.Math.PI],
    scripts: [scripts/empty-sample.groovy]}}
serializers:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
processors:
  - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
  - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}
metrics: {
  consoleReporter: {enabled: true, interval: 180000},
  csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
  jmxReporter: {enabled: true},
  slf4jReporter: {enabled: true, interval: 180000},
  gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
  graphiteReporter: {enabled: false, interval: 180000}}
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536

和 像这样的janusgraph-hbase-solr.properties :(其他字段默认注释行)

storage.backend=hbase
storage.hostname=127.0.0.1
cache.db-cache = true
cache.db-cache-clean-wait = 20
cache.db-cache-time = 180000
cache.db-cache-size = 0.5
index.search.backend=solr
index.search.solr.mode=http
index.search.solr.http-urls=http://localhost:8983/solr
gremlin.graph=org.janusgraph.core.JanusGraphFactory

当我跑步时

  

mvn exec:java -pl:example-remotegraph

命令它抛出

  

引起:org.apache.tinkerpop.gremlin.driver.exception.ResponseException:未知的外部索引后端:jgex       在org.apache.tinkerpop.gremlin.driver.Handler $ GremlinResponseHandler.channelRead0(Handler.java:244)       在org.apache.tinkerpop.gremlin.driver.Handler $ GremlinResponseHandler.channelRead0(Handler.java:195)       在io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)       在org.apache.tinkerpop.gremlin.driver.Handler $ GremlinSaslAuthenticationHandler.channelRead0(Handler.java:123)       在org.apache.tinkerpop.gremlin.driver.Handler $ GremlinSaslAuthenticationHandler.channelRead0(Handler.java:67)       在io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)       at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)       在org.apache.tinkerpop.gremlin.driver.handler.WebSocketClientHandler.channelRead0(WebSocketClientHandler.java:91)       在io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)       at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:312)       at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:286)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)       at io.netty.channel.DefaultChannelPipeline $ HeadContext.channelRead(DefaultChannelPipeline.java:1302)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)       at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)       at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)       at io.netty.channel.nio.AbstractNioByteChannel $ NioByteUnsafe.read(AbstractNioByteChannel.java:131)       在io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646)       在io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581)       at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)       在io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460)       at io.netty.util.concurrent.SingleThreadEventExecutor $ 2.run(SingleThreadEventExecutor.java:131)       ......还有1个

提前致谢。

1 个答案:

答案 0 :(得分:2)

听起来你可能使用了错误的属性文件。位于$JANUSGRAPH_HOME/examples/example-hbase/conf/下的分发中的此属性文件jgex-hbase-solr-http.properties包含jgex的索引定义:

index.jgex.backend=solr
index.jgex.index-name=jgex
index.jgex.hostname=127.0.0.1

index.jgex.solr.mode=http
index.jgex.solr.http-urls=http://127.0.0.1:8983/solr

如果您使用的是Solr Cloud而不是Solr HTTP,请使用同一目录中的jgex-hbase-solr-cloud.properties。

更新:根据您问题中的属性文件,请注意它定义了一个名为search的Solr索引(遵循模式index.[X].backend),这与示例目录中的不同并显示在我的回答,使用jgex

  

JanusGraph的索引选项以字符串" index。[X]开头。"其中" [X]"是后端的用户定义名称。在构建混合索引时,必须将此用户定义的名称传递给JanusGraph的ManagementSystem接口,如第9.1.2节“混合索引”中所述,以便JanusGraph知道可能使用多个已配置的索引后端。本章中的配置片段使用名称搜索,而散文对选项的讨论通常在同一位置写入[X]。只要在JanusGraph的配置中以及管理索引时一致使用,确切的索引名称就不重要。