1
votes

I've downloaded titan-server-0.4.4.zip and unzipped it and ran :

$ bin/titan.sh start

This started both Cassandra and Titan + Rexster. Now, I want to create a new graph for my application (say 'ggg') that I want to create from Bulbs in my Python source code. This is what I tried in the python2.7 console :

>>> from bulbs.titan import Graph, Config
>>> config = Config('/home/kevin/ggg') 
>>> g = Graph(config)     # Hoping that this will create all the graph related files

Now, I went to the rexster web interface and I could see only one graph named graph

{"version":"2.4.0","name":"Rexster: A Graph Server","graphs":["graph"],
"queryTime":0.567623,"upTime":"0[d]:05[h]:43[m]:05[s]"}

Is there something that I am doing wrong or missing? I tried looking at the documentation but couldn't find anything that helped me with this.

Thanks for your time.

2
Did this work for you?espeed
@espeed Both the answers helped. Is there a way to merge the answers or should I just accept any one answer?Kevin

2 Answers

1
votes

you need to edit rexster's config file to inform it about the new graph. this is my config/rexster.xml entry

<graph-name>productionDB</graph-name>
  <graphtype>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graphtype>
  <graph-location>/db/titan/main</graph-location>
  <graph-read-only>false</graph-read-only>
  <properties>
        <storage.backend>cassandra</storage.backend>
        <storage.hostname>127.0.0.1</storage.hostname>
        <storage.buffer-size>100</storage.buffer-size>
  </properties>
  <extensions>
    <allows>
      <allow>tp:gremlin</allow>
    </allows>
  </extensions>
</graph>
1
votes

Whereas Rexster supports multiple graphs on one server, Titan Server only supports one graph, and by default it's named "graph":

The bulbs.titan module is preconfigured to use graph as the name so to keep things simple, don't change the name in your Titan config, and thus you can then use the default Bulbs config without modifying it:

>>> from bulbs.titan import Graph
>>> g = Graph()   # using default config

See https://github.com/espeed/bulbs/blob/master/bulbs/titan/client.py#L29

BTW: If you were to use a different graph name, you'll need to supply its Titan Server URI, not the file path.

In other words, don't do this:

>>> config = Config('/home/kevin/ggg')

...do this...

>>> config = Config('http://localhost:8182/graphs/ggg')