Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 314
SteveB Avatar asked Aug 10 '16 20:08

SteveB


People also ask

Does Cqlsh support python3?

Released version of cqlsh supports only Python 2.7, so it can't work on the Python 3.

What is Cqlsh in Cassandra?

cqlsh is a command-line interface for interacting with Cassandra using CQL (the Cassandra Query Language). It is shipped with every Cassandra package, and can be found in the bin/ directory alongside the cassandra executable.


1 Answers

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.

like image 76
user1876190 Avatar answered Oct 14 '22 06:10

user1876190