首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在启动脚本中使用ConfiguredGraphFactory失败

在启动脚本中使用ConfiguredGraphFactory失败
EN

Stack Overflow用户
提问于 2020-05-13 12:54:56
回答 1查看 708关注 0票数 1

按照我的理解我正在遵循https://docs.janusgraph.org/basics/configured-graph-factory/#overview指南。

我想运行gremlin-server并设置一个图表。我希望在启动时执行一个常规脚本,该脚本打开或创建图形并为其设置模式。我使用Cassandra作为存储后端,启动方式如下所示:

代码语言:javascript
复制
cassandra -fR

原木嗡嗡作响。

我使用提供的配置文件,根据文档对它们进行调整。我的gremlin-server/gremlin-server.yaml未受影响,除了这些行:

代码语言:javascript
复制
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的内容也保持不变:

代码语言:javascript
复制
gremlin.graph=org.janusgraph.core.ConfiguredGraphFactory
storage.backend=cql
graph.graphname=ConfigurationManagementGraph
storage.hostname=127.0.0.1

下面是启动脚本empty-sample.groovy

代码语言:javascript
复制
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");

然后我像这样启动服务器,如下所示:

代码语言:javascript
复制
$ bin/gremlin-server.sh conf/gremlin-server/gremlin-server.yaml

但我得到一个错误,告诉我不存在顶点标签‘配置’。这似乎是一个schema=none问题,但我还没有触及架构。

代码语言:javascript
复制
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。

代码语言:javascript
复制
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)

是否有任何配置向导知道如何修复此问题?

EN

回答 1

Stack Overflow用户

发布于 2020-05-13 13:59:52

我能够通过删除以前在卡桑德拉制造的所有关键空间来修复这个问题。

我可能在某个时候用"schema.default"=none创建了schema.default。

我上面发布的配置应该在一个新的cassandra上工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61775222

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档