python driver - Getting timeout error when trying to connect to cassandra

1,089 views
Skip to first unread message

Nikhil Apte

unread,
May 17, 2016, 3:03:21 AM5/17/16
to DataStax Python Driver for Apache Cassandra User Mailing List
I have installed the python driver successfully but cannot connect to the cassandra server.
Fails with following error - 
  File "cassandra\cluster.py", line 882, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:12253)
  File "cassandra\cluster.py", line 908, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:12073)
  File "cassandra\cluster.py", line 902, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:11952)
  File "cassandra\cluster.py", line 2128, in cassandra.cluster.ControlConnection.connect (cassandra/cluster.c:37198)
  File "cassandra\cluster.py", line 2165, in cassandra.cluster.ControlConnection._reconnect_internal (cassandra/cluster.c:38095)
cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'<host_ip>': OperationTimedOut('errors=None, last_host=None',)})

I tried using the Java driver and that worked perfectly fine. The connection settings (host/port) are the same in both)

Alan Boudreault

unread,
May 17, 2016, 8:50:53 AM5/17/16
to python-dr...@lists.datastax.com
Hello Nikhil,

I´m afraid we will need more information to help you. The default connect_timeout is 5 seconds.So, your server doesn´t seem to respond within that timeout value. A few things to check:

- How long does it take for the Java driver to connect? I would expect that to be near 5 seconds.

Let me know how it goes.

Regards,
Alan

--
You received this message because you are subscribed to the Google Groups "DataStax Python Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-u...@lists.datastax.com.



--

Alan Boudreault
Software Engineer (Drivers) | alan.bo...@datastax.com


Nikhil Apte

unread,
May 17, 2016, 11:24:37 PM5/17/16
to python-dr...@lists.datastax.com
Thanks for the quick response. Will try out the things you have mentioned and will let you know.
-Nikhil
Reply all
Reply to author
Forward
0 new messages