按照我的理解我正在遵循https://docs.janusgraph.org/basics/configured-graph-factory/#overview指南。
我想运行gremlin-server并设置一个图表。我希望在启动时执行一个常规脚本,该脚本打开或创建图形并为其设置模式。我使用Cassandra作为存储后端,启动方式如下所示:
cassandra -fR原木嗡嗡作响。
我使用提供的配置文件,根据文档对它们进行调整。我的gremlin-server/gremlin-server.yaml未受影响,除了这些行:
channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
graphManager: org.janusgraph.graphdb.management.JanusGraphManager
graphs: {
ConfigurationManagementGraph: conf/gremlin-server/janusgraph-cassandra-es-server.properties
}除以下行外,conf/gremlin-server/janusgraph-cassandra-es-server.properties的内容也保持不变:
gremlin.graph=org.janusgraph.core.ConfiguredGraphFactory
storage.backend=cql
graph.graphname=ConfigurationManagementGraph
storage.hostname=127.0.0.1下面是启动脚本empty-sample.groovy
def globals = [:]
// defines a sample LifeCycleHook that prints some output to the Gremlin Server console.
// note that the name of the key in the "global" map is unimportant.
globals << [hook : [
onStartUp: { ctx ->
ctx.logger.info("Executed once at startup of Gremlin Server.")
},
onShutDown: { ctx ->
ctx.logger.info("Executed once at shutdown of Gremlin Server.")
}
] as LifeCycleHook]
Map map = new HashMap<String, Object>();
map.put("storage.backend", "cql");
map.put("storage.hostname", "127.0.0.1");
map.put("schema.default", "none");
map.put("graph.graphname", "test");
ConfiguredGraphFactory.createConfiguration(new MapConfiguration(map));
JanusGraph jGraph = ConfiguredGraphFactory.open("test");然后我像这样启动服务器,如下所示:
$ bin/gremlin-server.sh conf/gremlin-server/gremlin-server.yaml但我得到一个错误,告诉我不存在顶点标签‘配置’。这似乎是一个schema=none问题,但我还没有触及架构。
8137 [gremlin-server-exec-1] ERROR org.apache.tinkerpop.gremlin.jsr223.DefaultGremlinScriptEngineManager - Could not create GremlinScriptEngine for gremlin-groovy
java.lang.IllegalStateException: javax.script.ScriptException: javax.script.ScriptException: java.lang.IllegalArgumentException: Vertex Label with given name does not exist: Configuration
at org.apache.tinkerpop.gremlin.jsr223.DefaultGremlinScriptEngineManager.lambda$createGremlinScriptEngine$16(DefaultGremlinScriptEngineManager.java:464)编辑
在堆栈跟踪下,我也看到了这个。这感觉就像我缺少gremlin-groovy作为一个GremlinScriptEngine。
7535 [main] WARN org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - Could not initialize gremlin-groovy GremlinScriptEngine as init script could not be evaluated
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: gremlin-groovy is not an available GremlinScriptEngine
at java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:375)
at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1947)
at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.lambda$new$4(ServerGremlinExecutor.java:141)
at java.util.LinkedHashMap$LinkedKeySet.forEach(LinkedHashMap.java:559)
at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:136)
at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:122)
at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:86)
at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:345)
Caused by: java.lang.IllegalArgumentException: gremlin-groovy is not an available GremlinScriptEngine
at org.apache.tinkerpop.gremlin.jsr223.CachedGremlinScriptEngineManager.registerLookUpInfo(CachedGremlinScriptEngineManager.java:95)
at org.apache.tinkerpop.gremlin.jsr223.CachedGremlinScriptEngineManager.getEngineByName(CachedGremlinScriptEngineManager.java:58)
at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:267)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)是否有任何配置向导知道如何修复此问题?
发布于 2020-05-13 13:59:52
我能够通过删除以前在卡桑德拉制造的所有关键空间来修复这个问题。
我可能在某个时候用"schema.default"=none创建了schema.default。
我上面发布的配置应该在一个新的cassandra上工作。
https://stackoverflow.com/questions/61775222
复制相似问题