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

How to connect orientdb cluster with pyorient in python

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

不知道对你有没有用,这里link有一个OrientDB的例子python使用

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

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)

希望这会有所帮助 ;)