如何在python中连接orientdb集群和pyorient

如何在python中连接orientdb集群和pyorient,orientdb,Orientdb,如何在python中连接orientdb集群和pyorient? 我的orientdb集群在一台服务器中有两台主机,主机端口是2425和2426。我不知道它是否对您有用,这里有一个使用python的orientdb示例。我不知道它是否对您有用,这里有一个使用python的orientdb示例。您可以使用两个客户端,每个集群一个 client1 = pyorient.OrientDB("localhost", 2425) # I do not why yet, but you need to fi

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

我不知道它是否对您有用,这里有一个使用python的orientdb示例。

我不知道它是否对您有用,这里有一个使用python的orientdb示例。

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

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)

希望这会有所帮助;)

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

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)
希望这会有所帮助;)