Search code examples
cassandracqlcassandra-2.0cql3datastax

Cannot connect with CQL to Cassandra 2.0.10


In the server config, I've disabled thrift (start_rpc: false), because presumably that is now legacy. Server starts up fine:

INFO 12:23:09,658 Starting listening for CQL clients on localhost/127.0.0.1:9042... INFO 12:23:09,668 Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it

If I then try to start CQL, I get this error:

C:\Program Files\DataStax Community\apache-cassandra\bin> .\cqlsh.bat Connection error: Could not connect to localhost:9160

Port 9160 is the thrift port. I was under the assumption that CQL was supposed to run on the native format.

If I try to force the port:

C:\Program Files\DataStax Community\apache-cassandra\bin> .\cqlsh.bat localhost 9042

I get this:

Traceback (most recent call last): File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\..\apache-cassandra\bin\cqlsh", line 2092, in <module> main(*read_options(sys.argv[1:], os.environ)) File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\..\apache-cassandra\bin\cqlsh", line 2075, in main single_statement=options.execute) File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\..\apache-cassandra\bin\cqlsh", line 490, in __init__ password=password, cql_version=cqlver, transport=transport) File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\lib\cql-internal-only-1.4.1.zip\cql-1.4.1\cql\connection.py", line 143, in connect File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\lib\cql-internal-only-1.4.1.zip\cql-1.4.1\cql\connection.py", line 59, in __init__ File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\lib\cql-internal-only-1.4.1.zip\cql-1.4.1\cql\thrifteries.py", line 159, in establish_connection File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\lib\cql-internal-only-1.4.1.zip\cql-1.4.1\cql\cassandra\Cassandra.py", line 1265, in describe_version File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\lib\cql-internal-only-1.4.1.zip\cql-1.4.1\cql\cassandra\Cassandra.py", line 1275, in recv_describe_version File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\lib\thrift-python-internal-only-0.9.1.zip\thrift\protocol\TBinaryProtocol.py", line 126, in readMessageBegin File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\lib\thrift-python-internal-only-0.9.1.zip\thrift\protocol\TBinaryProtocol.py", line 206, in readI32 File "C:\Program Files\DataStax Community\apache-cassandra\bin\..\lib\thrift-python-internal-only-0.9.1.zip\thrift\transport\TTransport.py", line 63, in readAll EOFError


Solution

  • cqlsh for Cassandra 2.0.x uses Thrift to communicate with server.

    https://issues.apache.org/jira/browse/CASSANDRA-6307