Python 连接到远程TitanDB+;雷克斯特

Python 连接到远程TitanDB+;雷克斯特,python,cassandra,titan,bulbs,rexster,Python,Cassandra,Titan,Bulbs,Rexster,我用的是TitanGraphDB+Cassandra。我将以如下方式开始《泰坦》 cd titan-cassandra-0.3.1 bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties 我有一个雷克斯特外壳,可以用来和上面的泰坦+卡桑德拉通信 cd rexster-console-2.3.0 bin/rexster-console.sh 我正在尝试使用Titan Graph

我用的是TitanGraphDB+Cassandra。我将以如下方式开始《泰坦》

cd titan-cassandra-0.3.1
bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties
我有一个雷克斯特外壳,可以用来和上面的泰坦+卡桑德拉通信

cd rexster-console-2.3.0
bin/rexster-console.sh
我正在尝试使用Titan Graph DB对网络拓扑进行建模。我想从python程序中编程Titan Graph DB。为此,我使用了
python

from bulbs.titan import Graph 
self.g = Graph()
现在我在IP地址为
192.168.65.93
的机器上运行rexster控制台和Titan。如果我的python应用程序在同一台机器上运行,我将使用
self.g=Graph()

如果我想从
192.168.65.94上的python应用程序连接到运行在IP
192.168.65.93
机器上的
Titan和Rexster
,该怎么办


我该怎么做?我可以传递一些参数(例如配置文件到Graph())吗?在哪里可以找到它?

只需在bulls
Config
对象中设置Titan graph URI:

>>> from bulbs.titan import Graph, Config
>>> config = Config('http://192.168.65.93:8182/graphs/graph')
>>> g = Graph(config)
请参见灯泡
Config

和灯泡
Graph
(注意Titan的
Graph
类是Rexster的
Graph
类的一个子类)

我鼓励您通读灯泡快速入门和其他文档,因为其中许多问题都在那里得到了回答

快速启动使用
bulls.neo4jserver
作为示例,但由于无论您使用的是哪台后端服务器,bulls API都是一致的,因此快速启动示例也与Titan server和Rexster相关

要使Bulls Quickstart适应Titan或Rexster,只需更改
图形
从导入

>>> from bulbs.neo4jserver import Graph
>>> g = Graph()
…到

>>> from bulbs.titan import Graph
>>> g = Graph()
……或者

>>> from bulbs.rexster import Graph
>>> g = Graph()

这对您有用吗?使用Bulls.titan导入图中的
和Bulls.rexster导入图中的
有什么区别?他们是否都使用Rexster的RESTAPI与Titan数据库通信?如果是的话,你能指出其中一个的优点吗?