JanusGraph : Please add a key named “ConfigurationManagementGraph” to the “graphs”

后端 未结 1 1916
悲哀的现实
悲哀的现实 2020-12-21 04:47

I get the this error in gremlin console

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

         \\,,,/
         (o o)
-----oO         


        
相关标签:
1条回答
  • 2020-12-21 05:20

    There are a few things that you may have missed or perhaps are not clear in the ConfiguredGraphFactory docs:

    ConfiguredGraphFactory is used with a Gremlin Server, so you need to first make a remote connection. You should establish a sessioned remote connection, otherwise all of your template commands must be done in a single line request. When you interact with the ConfiguredGraphFactory from the Gremlin Console, you need to make sure you are sending your requests to the remote server. Typically you would do this by prepending your statements with :>. Alternatively, you could enter the remote console mode with :remote console which sends all commands to the remote server.

    You didn't include the details of your janusgraph-cassandra.properties, but it would probably be best if you start with the configuration files that are packaged in the distribution. By default, the pre-packaged distrubtion does not use the ConfiguredGraphFactory, so here are some steps you can take to try it out.

    # 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
    

    Be aware that gremlin-server.yaml and gremlin-server-configuration.yaml have significant differences. Refer to the docs in Chapter 8.7: Configuring JanusGraph Server for ConfiguredGraphFactory.

    In particular, gremlin-server-configuration.yaml defines:

    graphs: {
      ConfigurationManagementGraph: conf/janusgraph-cql-configurationgraph.properties
    }
    

    And conf/janusgraph-cql-configurationgraph.properties defines:

    graph.graphname=ConfigurationManagementGraph
    

    In your post, you are most likely getting an error because conf/janusgraph-cassandra.properties does not contain the correct graph.graphname.

    From this point, you can continue with the example Gremlin Console session listed here https://docs.janusgraph.org/latest/configuredgraphfactory.html#examples. As mentioned previously, the first two commands in the example are to establish the remote sessioned connection and to set the remote console mode:

    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
    

    I've created a full gist that shows all the steps on how to do this.

    0 讨论(0)
提交回复
热议问题