【问题标题】:How to create and start working with a graph database in Titan/Rexster from Bulbs如何在 Bulbs 的 Titan/Rexster 中创建和开始使用图形数据库
【发布时间】:2014-09-13 15:32:39
【问题描述】:

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

$ bin/titan.sh start

这开始于CassandraTitan + Rexster。现在,我想为我的应用程序(比如“ggg”)创建一个新图形,我想从 Python 源代码中的 Bulbs 创建它。这是我在 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 网络界面,我只能看到一个名为 graph 的图表

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

我做错了什么或遗漏了什么?我尝试查看文档,但找不到任何对我有帮助的东西。

感谢您的宝贵时间。

【问题讨论】:

  • 这对你有用吗?
  • @espeed 两个答案都有帮助。有没有办法合并答案或者我应该接受任何一个答案?

标签: cassandra titan tinkerpop bulbs rexster


【解决方案1】:

您需要编辑 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>

【讨论】:

    【解决方案2】:

    Rexster 在一台服务器上支持多张图,而 Titan Server 只支持一张图,默认命名为“graph”:

    bulbs.titan module 已预先配置为使用 graph 作为名称,因此为简单起见,请勿在 Titan 配置中更改名称,这样您就可以使用默认灯泡配置而无需修改它:

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

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

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

    换句话说,不要这样做:

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

    ...这样做...

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

    【讨论】:

      猜你喜欢
      • 2014-10-05
      • 2013-10-08
      • 2016-09-03
      • 1970-01-01
      • 2015-02-15
      • 2016-05-15
      • 2016-06-29
      • 2014-07-10
      • 1970-01-01
      相关资源
      最近更新 更多