Search code examples
cassandracqlsh

Apache Cassandra - cqlsh operation timeout


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?


Solution

  • 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>