如何在python中将orientdb集群与pyorient连接起来

时间:2016-03-28 08:59:48

标签: orientdb

如何在python中将orientdb集群与pyorient连接? 我的orientdb集群在一个服务器中有两个主机,主机端口是2425和2426。

2 个答案:

答案 0 :(得分:0)

我不知道它是否对你有用,在这个link有一个使用python的OrientDB的例子。

答案 1 :(得分:0)

您可以使用两个客户端,每个群集一个。

client1 = pyorient.OrientDB("localhost", 2425)
# I do not why yet, but you need to first connect as root.
session1_id = client1.connect('root',root_password) 
cluster1_info = client1.db_open(db_name, db_username, user_password)

然后是你的其他客户

client2 = pyorient.OrientDB("localhost", 2426)

session2_id = client2.connect('root',root_password) 
cluster2_info = client2.db_open(db_name, db_username, user_password)

希望这会有所帮助;)