Hi All,

I am trying to connect/open orientdb using pyorient.
However both connect and open give
PyOrientConnectionException: Socket Error: [Errno 111] Connection refused.
Do I need to open up any port explicitly ?

I am able to connect to orientdb from orientdb console.

orientdb> connect remote:localhost/testdb admin admin
Connecting to database [remote:localhost/testdb] with user 'admin'...OK

In [1]: import pyorient
In [2]: client = pyorient.OrientDB("localhost", 2424)
In [3]: client.set_session_token(True)
Out[3]: <pyorient.orient.OrientDB object at 0xc04610>
*In [4]: session_id = client.connect("admin", "admin")*
---------------------------------------------------------------------------
PyOrientConnectionException               Traceback (most recent call last)

/home/admin/<ipython console> in <module>()

/home/admin/pyorient/orient.pyc in connect(self, user, password, client_id, 
serialization_type)
    290 
    291         '''
--> 292         return self.get_message("ConnectMessage") \
    293             .prepare((user, password, client_id, 
serialization_type)).send().fetch_response()
    294 

/home/admin/pyorient/orient.pyc 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/admin/pyorient/messages/connection.pyc in __init__(self, 
_orient_socket)
     15 
     16     def __init__(self, _orient_socket):
---> 17         super( ConnectMessage, self ).__init__(_orient_socket)
     18 
     19         self._user = ''

/home/admin/pyorient/messages/base.pyc in __init__(self, sock)
     22         :type sock: OrientSocket
     23         """
---> 24         sock.get_connection()
     25         self._orientSocket = sock
     26         self._protocol = self._orientSocket.protocol

/home/admin/pyorient/orient.pyc in get_connection(self)
     50     def get_connection(self):
     51         if not self.connected:
---> 52             self.connect()
     53 
     54         return self._socket

/home/admin/pyorient/orient.pyc in connect(self)
     80         except socket.error as e:
     81             self.connected = False
---> 82             raise PyOrientConnectionException( "Socket Error: %s" % 
e, [] )
     83 
     84     def close(self):

PyOrientConnectionException: Socket Error: [Errno 111] Connection refused

*In [5]: client.db_open( "testdb", "admin", "admin" )*
---------------------------------------------------------------------------
PyOrientConnectionException               Traceback (most recent call last)

/home/admin/<ipython console> in <module>()

/home/admin/pyorient/orient.pyc 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/admin/pyorient/orient.pyc 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/admin/pyorient/messages/database.pyc 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/admin/pyorient/messages/base.pyc in __init__(self, sock)
     22         :type sock: OrientSocket
     23         """
---> 24         sock.get_connection()
     25         self._orientSocket = sock
     26         self._protocol = self._orientSocket.protocol

/home/admin/pyorient/orient.pyc in get_connection(self)
     50     def get_connection(self):
     51         if not self.connected:
---> 52             self.connect()
     53 
     54         return self._socket

/home/admin/pyorient/orient.pyc in connect(self)
     80         except socket.error as e:
     81             self.connected = False
---> 82             raise PyOrientConnectionException( "Socket Error: %s" % 
e, [] )
     83 
     84     def close(self):

PyOrientConnectionException: Socket Error: [Errno 111] Connection refused

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to