簡體   English   中英

如何使用pyorient驅動程序建立與OrientDB分布式數據庫的遠程連接?

[英]How to a establish remote connection to OrientDB distributed db using pyorient driver?

Hej,我正在嘗試建立到我在數字海洋上的orientdb服務器的遠程連接。

但是,我嘗試通過以下方式進行連接:

client =pyorient.OrientDB(host='remote.host.ip', port=2480)
cluster_info = client.db_open(db_name, db_username, db_password)

我收到以下錯誤PyOrientConnectionPoolException: Server sent empty string

---------------------------------------------------------------------------
PyOrientConnectionPoolException           Traceback (most recent call last)
<ipython-input-26-f9fe1d9a9205> in <module>()
----> 1 cluster_info = client.db_open(db_name, db_username, db_password)

/home/jb/anaconda3/envs/myenv/lib/python3.5/site-packages/pyorient/orient.py in db_open(self, db_name, user, password, db_type, client_id)
    376         '''
    377 
--> 378         info, clusters, nodes = self.get_message("DbOpenMessage") \
    379             .prepare((db_name, user, password, db_type, client_id)).send().fetch_response()
    380 

/home/jb/anaconda3/envs/myenv/lib/python3.5/site-packages/pyorient/orient.py in get_message(self, command)
    487                     token = self._auth_token
    488 
--> 489                 message_instance = _Message(self._connection)\
    490                     .set_session_token(token)
    491                 message_instance._push_callback = self._push_received

/home/jb/anaconda3/envs/myenv/lib/python3.5/site-packages/pyorient/messages/database.py in __init__(self, _orient_socket)
     45 class DbOpenMessage(BaseMessage):
     46     def __init__(self, _orient_socket):
---> 47         super(DbOpenMessage, self).__init__(_orient_socket)
     48 
     49         self._user = ''

/home/jb/anaconda3/envs/myenv/lib/python3.5/site-packages/pyorient/messages/base.py in __init__(self, sock)
     22         :type sock: OrientSocket
     23         """
---> 24         sock.get_connection()
     25         self._orientSocket = sock
     26         self._protocol = self._orientSocket.protocol

/home/jb/anaconda3/envs/myenv/lib/python3.5/site-packages/pyorient/orient.py in get_connection(self)
     50     def get_connection(self):
     51         if not self.connected:
---> 52             self.connect()
     53 
     54         return self._socket

/home/jb/anaconda3/envs/myenv/lib/python3.5/site-packages/pyorient/orient.py in connect(self)
     69 
     70                 raise PyOrientConnectionPoolException(
---> 71                     "Server sent empty string", []
     72                 )
     73 

我正在運行pyorient v 1.5.4和Anaconda3 python 3.5發行版。

有什么提示嗎?

我發現了我的錯誤,這是端口值上的一個愚蠢錯誤,它應該是port:2424而不是屬於OrientDB studio的port:2480

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM