Apache Cassandra 3.7 CQLSH 'Unable to connect to any servers'

SteveB picture SteveB · Aug 10, 2016 · Viewed 13k times · Source

Apache cassandra version 3.7 is running on Ubuntu server 16.04 fine, all parts of apache cassandra started up no problem, the issue is, i go to connect using cqlsh: $ CQLSH (My IP Address) 9160 then it says: Connection error: ('Unable to connect to any servers', {'10.0.0.13': TypeError('ref() does not take keyword arguments',)} ) i seen there was a bug for it: https://issues.apache.org/jira/browse/CASSANDRA-11850 but its for version cqlsh --version: cqlsh 5.0.1 cassandra -v: 3.5 (also occurs with 3.0.6)

Someone commented on my Apache Cassandra ticket: https://issues.apache.org/jira/browse/CASSANDRA-12402 stating: Use the workaround described in the ticket: If you have an up-to-date cassandra-driver installed, you can disable the embedded driver by setting the environment variable CQLSH_NO_BUNDLED to any non empty string, for example export CQLSH_NO_BUNDLED=true.

QUESTIONS ARE:

How do i disable the up-to-date cassandra-driver? what directory is it in? what file name? also if i disable it, will i be able to connect using CQLSH? what tool did you guys use to connect to apache cassandra to run commands etc. Besides CQLSH directly on the server?

Answer

user1876190 picture user1876190 · Aug 16, 2016

As described in the ticket - define environment variable CQLSH_NO_BUNDLED and export it.

export CQLSH_NO_BUNDLED=true

It will tell cqlsh (which is Python program) to use external Cassandra Python driver, not the one bundled with the distribution. The bundled Cassandra driver is located in /opt/datastax-ddc-3.7.0/bin, the file name is cassandra-driver-internal-only-3.0.0-6af642d.zip

Then run cqlsh, which is located in /opt/datastax-ddc-3.7.0/bin.

./cqlsh

It is possible that you will need to install Cassandra Python driver (if it was not installed already) using:

pip install cassandra-driver 

Note - folder names are for Datastax Cassandra build.