Cassandra 如何从Bulls创建Titan/Rexster中的图形数据库并开始使用

Cassandra 如何从Bulls创建Titan/Rexster中的图形数据库并开始使用,cassandra,titan,tinkerpop,bulbs,rexster,Cassandra,Titan,Tinkerpop,Bulbs,Rexster,我已经下载了titan-server-0.4.4.zip并将其解压缩并运行: $ bin/titan.sh start 这同时启动了卡桑德拉和泰坦+雷克斯特。现在,我想为我的应用程序创建一个新的图形(比如说“ggg”),我想在Python源代码中用灯泡创建它。这是我在python2.7控制台中尝试的: >>> from bulbs.titan import Graph, Config >>> config = Config('/home/kevin/ggg'

我已经下载了
titan-server-0.4.4.zip
并将其解压缩并运行:

$ bin/titan.sh start
这同时启动了卡桑德拉和泰坦+雷克斯特。现在,我想为我的应用程序创建一个新的图形(比如说“ggg”),我想在Python源代码中用灯泡创建它。这是我在python2.7控制台中尝试的:

>>> from bulbs.titan import Graph, Config
>>> config = Config('/home/kevin/ggg') 
>>> g = Graph(config)     # Hoping that this will create all the graph related files
现在,我转到rexster web界面,我只能看到一个名为
graph

{"version":"2.4.0","name":"Rexster: A Graph Server","graphs":["graph"],
"queryTime":0.567623,"upTime":"0[d]:05[h]:43[m]:05[s]"}
是否有我做错或遗漏的事情?我试图查看文档,但找不到任何对我有帮助的东西


谢谢您的时间。

您需要编辑rexster的配置文件,以通知它有关新图形的信息。 这是我的config/rexster.xml条目

<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>
productionDB
com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration
/db/titan/main
假的
卡桑德拉
127.0.0.1
100
小精灵

虽然Rexster支持一台服务器上的多个图形,但Titan server只支持一个图形,默认情况下它的名称为“图形”:

bulls.titan模块
已预配置为使用
graph
作为名称,因此为了简单起见,不要更改titan配置中的名称,因此您可以使用默认的bulls配置,而无需修改它:

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

顺便说一句:如果要使用不同的图名,则需要提供其Titan服务器URI,而不是文件路径

换句话说,不要这样做:

>>> config = Config('/home/kevin/ggg')
…这样做

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

这对你有用吗?@espeed两个答案都有帮助。有没有合并答案的方法,或者我应该只接受一个答案?