почему фабрика конфигурации janusgraph не работает? - PullRequest
0 голосов
/ 25 октября 2019

кто-нибудь может мне помочь?

когда я настраиваю janusgraoh factory как инструкция , но я могу ConfiguredGraphFactory.createConfiguration(new MapConfiguration(map)); я не могу открыть график: ConfiguredGraphFactory.open("graph1")

этоis gremlin.yaml

    host: 0.0.0.0
    port: 8183
    scriptEvaluationTimeout: 10000000
    channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
    graphManager: org.janusgraph.graphdb.management.JanusGraphManager
    graphs: {
          ConfigurationManagementGraph: conf/janusgraph-cql-configurationgraph.properties

это janusproperties:


        gremlin.graph=org.janusgraph.core.ConfiguredGraphFactory
        graph.graphname=ConfigurationManagementGraph
        storage.backend=cql
        index.ES.backend=elasticsearch
        index.ES.hostname=127.0.0.1

curl localhost: 8183 -d '{"gremlin": "ConfiguredGraphFactory.open (/ graph1 /). vertices () "} '|python -m json.tool

"stackTrace": "com.datastax.driver.core.exceptions.SyntaxError: line 2:33 : syntax 
error...\n\ n\ tat
com.datastax.driver.core.Responses$Error.asException(Responses.java: 143)\ n\ tat
com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java: 179)\ n\ tat
com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java: 196)\ n\ tat
com.datastax.driver.core.RequestHandler.access$2500(RequestHandler.java: 50)\ n\ tat com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java: 827)\ n\ tat
com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java: 661)\ n\ tat com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java: 1083)\ n\ tat com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java: 1006)\ n\ tat
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java: 105)\ n\ tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 356)\ n\ tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 342)\ n\ tat
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java: 335)\ n\ tat io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java: 286)\ n\ tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 356)\ n\ tat
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 342)\ n\ tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java: 335)\ n\ tat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java: 102)\ n\ tat
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 356)\ n\ tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 342)\ n\ tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java: 335)\ n\ tat
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java: 312)\ n\ tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java: 286)\ n\ tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 356)\ n\ tat
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 342)\ n\ tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java: 335)\ n\ tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java: 1304)\ n\ tat
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 356)\ n\ tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java: 342)\ n\ tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java: 921)\ n\ tat
io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java: 725)\ n\ tat io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java: 400)\ n\ tat io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java: 300)\ n\ tat
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java: 131)\ n\ tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java: 30)\ n\ tat java.lang.Thread.run(Thread.java: 748)\ n " }

1 Ответ

0 голосов
/ 04 ноября 2019

Ваш файл конфигурации для сервера не является допустимым файлом YAML, поскольку он неполный. Это должно выглядеть примерно так :

# Copyright 2019 JanusGraph Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

host: 0.0.0.0
port: 8182
scriptEvaluationTimeout: 30000
channelizer: org.janusgraph.channelizers.JanusGraphWebSocketChannelizer
graphManager: org.janusgraph.graphdb.management.JanusGraphManager
graphs: {
  ConfigurationManagementGraph: conf/janusgraph-cql-configurationgraph.properties
}
scriptEngines: {
  gremlin-groovy: {
    plugins: { org.janusgraph.graphdb.tinkerpop.plugin.JanusGraphGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
               org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: []}}}}
serializers:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  # Older serialization versions for backwards compatibility:
  - { 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.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
  - { 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
...