Apache Cassandra - cqlsh operation timeout

3.9k views Asked by At

I am trying to start cqlsh and this is what I get:

/bin$ ./cqlsh
Connection error: ('Unable to connect to any servers', {'127.0.0.1': 
    OperationTimedOut('errors=None, last_host=None',)})

I tried removing ~/.cassandra, did not work. I also compared cassandra.yaml with a version that worked.

Any ideas?

2

There are 2 answers

0
Aaron On BEST ANSWER

Depending on your version and configuration, check the values specified for listen_address and/or rpc_address in your cassandra.yaml. If they are defined to anything other than localhost, you will need to provide that address when connecting with cqlsh.

$ grep listen_address: /etc/cassandra/cassandra.yaml
listen_address: 210.156.89.15

$ cqlsh 210.156.89.15 -u aploetz -p aploetz 
Connected to PermanentWaves at 210.156.89.15.
[cqlsh 5.0.1 | Cassandra 2.1.4 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
aploetz@cqlsh>
0
lounagen On

posting on this old thread as a memo for others, as i couln't managed to find any info to resolve these symptoms without debugging up to now:

got the same issue with a slow testing cluster, and i resolved it by setting a missing control_connection_timeout kwargs in Cluster() init, in cqlsh.py file.

issue opened and patch proposal provided at https://issues.apache.org/jira/browse/CASSANDRA-10959