gpt4 book ai didi

graph-databases - JanusGraph : Please add a key named "ConfigurationManagementGraph" to the "graphs"

转载 作者:行者123 更新时间:2023-12-04 07:14:46 35 4
gpt4 key购买 nike

我在 gremlin 控制台中收到此错误

cegprakash@cegprakash:~/workspace/janusgraph-0.2.1-hadoop2$ ./bin/gremlin.sh 

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: janusgraph.imports
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/cegprakash/workspace/janusgraph-0.2.1-hadoop2/lib/slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/cegprakash/workspace/janusgraph-0.2.1-hadoop2/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
19:10:12 WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
plugin activated: tinkerpop.hadoop
plugin activated: tinkerpop.spark
plugin activated: tinkerpop.tinkergraph
gremlin> def graph=ConfiguredGraphFactory.create("mygraph")
org.janusgraph.graphdb.management.utils.ConfigurationManagementGraphNotEnabledException: Please add a key named "ConfigurationManagementGraph" to the "graphs" property in your YAML file and restart the server to be able to use the functionality of the ConfigurationManagementGraph class.
Type ':help' or ':h' for help.
Display stack trace? [yN]

编辑:
我也遵循了 Jason Plurad 在答案中的步骤。

conf/gremlin-server/gremlin-server.yaml
host: 0.0.0.0
port: 8182
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
ConfigurationManagementGraph: conf/janusgraph-cassandra-configurationgraph.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-cassandra-configurationgraph.properties 文件
gremlin.graph=org.janusgraph.core.ConfiguredGraphFactory
graph.graphname=ConfigurationManagementGraph
storage.backend=cassandrathrift
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

然后我做了
./bin/janusgraph.sh clean
Are you sure you want to delete all stored data and logs? [y/N] y
Deleted data in /home/cegprakash/workspace/janusgraph-0.2.1-hadoop2/db
Deleted logs in /home/cegprakash/workspace/janusgraph-0.2.1-hadoop2/log

其次是
cegprakash@cegprakash:~/workspace/janusgraph-0.2.1-hadoop2$ ./bin/janusgraph.sh start
Forking Cassandra...
Running `nodetool statusthrift`.... OK (returned exit status 0 and printed string "running").
Forking Elasticsearch...
Connecting to Elasticsearch (127.0.0.1:9200)....... OK (connected to 127.0.0.1:9200).
Forking Gremlin-Server...
Connecting to Gremlin-Server (127.0.0.1:8182)..... OK (connected to 127.0.0.1:8182).
Run gremlin.sh to connect.

其次是
cegprakash@cegprakash:~/workspace/janusgraph-0.2.1-hadoop2$ ./bin/gremlin.sh 

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: janusgraph.imports
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/cegprakash/workspace/janusgraph-0.2.1-hadoop2/lib/slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/cegprakash/workspace/janusgraph-0.2.1-hadoop2/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
19:35:47 WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
plugin activated: tinkerpop.hadoop
plugin activated: tinkerpop.spark
plugin activated: tinkerpop.tinkergraph
gremlin> :remote connect tinkerpop.server conf/remote.yaml session
==>Configured localhost/127.0.0.1:8182-[14455470-addc-49ed-ae54-a30de1fd8ae8]
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182]-[14455470-addc-49ed-ae54-a30de1fd8ae8] - type ':remote console' to return to local mode
gremlin> def graph=ConfiguredGraphFactory.create("mygraph")
Please add a key named "ConfigurationManagementGraph" to the "graphs" property in your YAML file and restart the server to be able to use the functionality of the ConfigurationManagementGraph class.
Type ':help' or ':h' for help.
Display stack trace? [yN]

最佳答案

ConfiguredGraphFactory docs 中有一些您可能遗漏或不清楚的内容。 :

ConfiguredGraphFactory 与 Gremlin Server 一起使用,因此您需要先进行远程连接。您应该建立一个 session 远程连接,否则您的所有模板命令都必须在单行请求中完成。当您从 Gremlin 控制台与 ConfiguredGraphFactory 交互时,您需要确保将请求发送到远程服务器。通常,您可以通过在语句前加上 :> 来做到这一点。 .或者,您可以使用 :remote console 进入远程控制台模式。它将所有命令发送到远程服务器。

您没有包含您的 janusgraph-cassandra.properties 的详细信息,但最好从分发中打包的配置文件开始。默认情况下,预打包的发行版不使用 ConfiguredGraphFactory,因此您可以采取一些步骤来试用它。

# clean out any previous runs
bin/janusgraph.sh clean
Are you sure you want to delete all stored data and logs? [y/N] y
Deleted data in /opt/janusgraph-0.2.1-hadoop2/db
Deleted logs in /opt/janusgraph-0.2.1-hadoop2/log

# backup the default Gremlin Server configuration
cp conf/gremlin-server/gremlin-server.yaml conf/gremlin-server/gremlin-server.yaml.orig

# make the ConfiguredGraphFactory configuration the default
cp conf/gremlin-server/gremlin-server-configuration.yaml conf/gremlin-server/gremlin-server.yaml

# start Cassandra, Elasticsearch, Gremlin Server
bin/janusgraph.sh start

# start Gremlin Console
bin/gremlin.sh

请注意 gremlin-server.yamlgremlin-server-configuration.yaml有显着差异。请参阅 Chapter 8.7: Configuring JanusGraph Server for ConfiguredGraphFactory 中的文档.

特别是 gremlin-server-configuration.yaml定义:
graphs: {
ConfigurationManagementGraph: conf/janusgraph-cql-configurationgraph.properties
}

conf/janusgraph-cql-configurationgraph.properties定义:
graph.graphname=ConfigurationManagementGraph

在您的帖子中,您很可能会收到错误消息,因为 conf/janusgraph-cassandra.properties不包含正确的 graph.graphname .

从这一点开始,您可以继续使用此处列出的示例 Gremlin 控制台 session https://docs.janusgraph.org/latest/configuredgraphfactory.html#examples .如前所述,示例中的前两个命令是建立远程 session 连接和设置远程控制台模式:
gremlin> :remote connect tinkerpop.server conf/remote.yaml session
==>Configured localhost/127.0.0.1:8182

gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost:8182]-[5206cdde-b231-41fa-9e6c-69feac0fe2b2] - type ':remote console' to return to local mode

我创建了一个 full gist这显示了如何做到这一点的所有步骤。

关于graph-databases - JanusGraph : Please add a key named "ConfigurationManagementGraph" to the "graphs",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51594838/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com