15

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?

user7337271
  • 1,662
  • 1
  • 14
  • 23
SteveB
  • 173
  • 1
  • 1
  • 10

2 Answers2

32

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.

user1876190
  • 450
  • 4
  • 6
  • 1
    Thanks, though had to use "sudo pip install cassandra-driver". Putting this out there because it timed out before getting the permissions error message. – Rdesmond Aug 16 '16 at 22:45
  • I am still getting another error after install the latest cassandra driver: Traceback (most recent call last): File "/cassandra/bin/cqlsh", line 109, in from cassandra.cluster import Cluster, PagedResult ImportError: cannot import name PagedResult Any ideas? – Patrick Aug 29 '16 at 22:35
  • 1
    @Patrick this message has to do withthe **cassandra-driver** version. Try: `pip install cassandra-driver==2.7.2` – pbo Sep 15 '16 at 20:06
0

It's probably due to python version. Here is a ticket marked as resolved. cqlsh connection error: 'ref() does not take keyword arguments'

I tried on my side. After reverting python to 2.7.10, it works well.

Community
  • 1
  • 1