【发布时间】:2013-04-30 03:08:00
【问题描述】:
我玩Titan graph server 已经有一段时间了。我的感觉是,尽管有大量文档,但缺少从头开始教程。
我的最终目标是让一个泰坦在 cassandra 上运行并使用 StartTheShift/thunderdome 进行查询。
我见过几种启动 Titan 的方法:
使用 Rexster
来自this link,我能够通过以下步骤运行一个 Titan 服务器:
- 下载rexster-server 2.3
- 下载titan 0.3.0
- 将所有文件从
titan-all-0.3.0/libs复制到rexster-server-2.3.0/ext/titan -
编辑
rexster-server-2.3.0/rexster.xml并添加(在 a 之间):<graph> <graph-name>geograph</graph-name> <graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type> <graph-read-only>false</graph-read-only> <graph-location>/Users/vallette/projects/DATA/gdb</graph-location> <properties> <storage.backend>local</storage.backend> <storage.directory>/Users/vallette/projects/DATA/gdb</storage.directory> <buffer-size>100</buffer-size> </properties> <extensions> <allows> <allow>tp:gremlin</allow> </allows> </extensions> </graph>
对于 berkeleydb 或:
<graph>
<graph-name>geograph</graph-name>
<graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
<graph-location></graph-location>
<graph-read-only>false</graph-read-only>
<properties>
<storage.backend>cassandra</storage.backend>
<storage.hostname>77.77.77.77</storage.hostname>
</properties>
<extensions>
<allows>
<allow>tp:gremlin</allow>
</allows>
</extensions>
</graph>
对于 cassandra 数据库。
- 使用
./bin/rexster.sh -s -c rexster.xml启动服务器 - 下载 rexster 控制台并使用
bin/rexster-console.sh运行它 - 您现在可以使用
g = rexster.getGraph("geograph")连接到您的图表
此方法的问题在于您是通过 rexster 而不是 gremlin 连接的,因此您没有自动完成功能。优点是您可以命名您的数据库(此处为地理)。
将 Titan 服务器与 cassandra 一起使用
- 用
./bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties启动服务器 -
创建一个名为
cassandra.local的文件storage.backend=cassandrathrift storage.hostname=127.0.0.1 启动 titan gremlin 并连接到
g = TitanFactory.open("cassandra-es.local")
这很好用。
在 BerkeleyDB 中使用 Titan 服务器
来自this link:
- 下载titan 0.3.0
- 用
./bin/titan.sh config/titan-server-rexster.xml config/titan-server-berkeleydb.properties启动服务器 - 启动泰坦小精灵:
./bin/gremlin.sh -
但是一旦我尝试使用
g = TitanFactory.open('graph')连接到 gremlin 中的数据库(图形),它就会在我所在的目录中创建一个名为 graph 的新数据库。如果我在我的目录(已填充)所在的位置执行此操作,我会得到:无法实例化实现:com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager
有人可以澄清这些过程,并告诉我我做错了什么。 谢谢
【问题讨论】:
标签: graph-databases gremlin titan rexster