Connection error: Unable to connect to any servers OperationTimedOut

Connection error: Unable to connect to any servers OperationTimedOut

When trying to connect to cassandra via cqlsh client, I've offen had the following timeout errors:

Connection error: ('Unable to connect to any servers', {'1xx.xx.xx.xx': OperationTimedOut('errors=None, last_host=None',)})

Lots of blog posts out there recommend editing the:

~./cassandra/cqlshrc

and increasing:

[connection]
client_timeout = 3600
request_timeout = 3600

This did not work for me. What really worked is editing the:

/usr/bin/cqlsh.py

and changing:

DEFAULT_CONNECT_TIMEOUT_SECONDS = 3600
DEFAULT_REQUEST_TIMEOUT_SECONDS = 3600

Hope it helps.