Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra cqlsh "unable to connect to any servers"

I get the following message when executing cqlsh.bat on the command line

Connection error: ('Unable to connect to any servers', {'127.0.0.1': ProtocolError("cql_version '3.3.0' is not supported by remote (w/ native protocol). Supported versions: [u'3.2.0']",)}) 

I'm running Python version 2.7.10 along with Cassandra version 2.2.1. Not sure if it's related but when I start the Cassandra server I need to run "Set-ExecutionPolicy Unrestricted" on PowerShell or else it doesn't work.

like image 613
cdn Avatar asked Oct 07 '15 21:10

cdn


People also ask

Can not connect to Cassandra?

You can ensure this by using "telnet thecassandrahost 9042" from the remote machine, it should not work. In order to bind Cassandra to the external network interface you need to edit the cassandra. yaml configuration file and set the properties " listen_address " and " rpc_address " to your remote IP or "0.0.

What protocol Cqlsh uses to connect to a Cassandra node?

cqlsh is implemented with the Python native protocol driver, and connects to the single specified node.


1 Answers

You can force cqlsh to use a specific cql version using the flag

--cqlversion="#.#.#"

Example cqlsh usage (and key/values):

cqlsh 12.34.56.78 1234 -u username -p password --cqlversion="3.2.0" cqlsh (IP ADDR)  (PORT)  (DB_USERN)  (DB_PASS)               (VER) 
like image 143
Eric Walsh Avatar answered Sep 23 '22 08:09

Eric Walsh