我已经看到了几种启动Titan的方法:
使用Rexster
从此链接中,我能够通过以下步骤运行titan服务器:- download rexster-server 2.3
- download titan 0.3.0
- copy all files from
titan-all-0.3.0/libs
torexster-server-2.3.0/ext/titan
edit
rexster-server-2.3.0/rexster.xml
and add (between 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连接的,因此您没有自动完成功能。优点是您可以命名您的数据库(这里是geograph)。
使用Titan服务器与Cassandra
- start the server with
./bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties
create a file called
cassandra.local
withstorage.backend=cassandrathrift storage.hostname=127.0.0.1
start titan gremlin and connect with
g = TitanFactory.open("cassandra-es.local")
这个能正常工作。
使用BerkeleyDB的Titan服务器
从这个链接:
- 下载 titan 0.3.0
- 使用
./bin/titan.sh config/titan-server-rexster.xml config/titan-server-berkeleydb.properties
启动服务器 - 启动titan gremlin:
./bin/gremlin.sh
但是,一旦我尝试在gremlin中使用
g = TitanFactory.open('graph')
连接到数据库(图形),它会在我所在的目录中创建一个名为graph的新数据库。如果我在我的目录(已填写)中执行此操作,则会出现以下错误:无法实例化实现:com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager
有人能澄清这些过程,并告诉我我做错了什么。 谢谢