2017-02-10 25 views
1

Hej, 我正試圖建立一個遠程連接到我的東方數字海洋上的東方服務器。如何使用pyorient驅動程序建立與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蟒蛇3.5分佈。

任何提示?

回答

2

我發現我的錯誤,對端口值應該是port:2424而不是port:2480屬於OrientDB工作室一個愚蠢的錯誤。

相關問題