Bindings for graphs created using ConfiguredGraphFactory not working as expected


anya.sharma@...
 
Edited

Hello,

I have a local setup of JanusGraph 0.6.0 with Cassandra 3.11.9. I am creating a graph using the ConfiguredGraphFactory. For this, I am using the bundled properties and yaml files and creating the graph by running the following commands from the Gremlin console (also bundled with the JanusGraph installation):

gremlin> :remote connect tinkerpop.server conf/remote.yaml session
gremlin> :remote console
gremlin> map.put('storage.backend', 'cql');
gremlin> map.put('storage.hostname', '127.0.0.1');
gremlin> map.put('graph.graphname', 'graph1');
gremlin> map.put('storage.username', 'myDBUsername');
gremlin> map.put('storage.password', 'myDBPassword');
gremlin> ConfiguredGraphFactory.createConfiguration(new MapConfiguration(map));

Once I have created the map, I try to access the graph and the traversal variables bound to it, but I get the following response:

gremlin>ConfiguredGraphFactory.open('graph1')
gremlin> graph1
No such property: graph1 for class: Script7
 
gremlin> graph1_traversal
No such property: graph1_traversal for class: Script8
 
I am using the gremlin-server-configuration.yaml and janusgraph-cql-configuration.properties bundled with the JanusGraph installation package. The only changes I have made are adding the credentials and custom graph.graphname:

graph.graphname=graph1_config
storage.hostname=127.0.0.1
storage.username=myDBUsername
storage.password=myDBPassword

According to the documentation, I should be able to access the bound variables. I was able to do this in the 0.3.1 version of Janusgraph. What could I be missing/doing wrong?

Thanks
Anya


hadoopmarc@...
 

Hi Anya,

In v0.6.0 the bin/janusgraph-server.sh start script does not start Cassandra any more. Are you sure you did start Cassandra ("cassandra/bin/cassandra") before starting JanusGraph?
Also check whether you did not mix up the graph1 and graph1_config graph.graphname values.

I guess you found out to do (before running bin/janusgraph-server.sh):
export JANUSGRAPH_YAML=conf/gremlin-server/gremlin-server-configuration.yaml

Best wishes,      Marc


anya.sharma@...
 

Hello Marc,

Thank you for your reply. In response to your suggestions and the questions you posed:
Are you sure you did start Cassandra ("cassandra/bin/cassandra") before starting JanusGraph? - Yes, the Cassandra server is running. I am not using the Cassandra bundled with JanusGraph, but my own separate installation which was running at the time when I faced this issue.
Also check whether you did not mix up the graph1 and graph1_config graph.graphname values - I double-checked, and the values for the graph name that I am using are correct.
I guess you found out to do (before running bin/janusgraph-server.sh):
export JANUSGRAPH_YAML=conf/gremlin-server/gremlin-server-configuration.yaml - I am running the server using the command - gremlin-server.bat conf/gremlin-server/gremlin-server-configuration.yaml instead of storing the yaml file in an environment variable. 

Apart from the above, I also ran the same commands as mentioned in my question on a 0.3.1 JanusGraph server and it worked:

Creating the graph:


Accessing the graph through the implicit variables:



The same steps give the issue posed in the question when run using JanusGraph 0.6.0:


Thanks
Anya