Cassandra cqlsh “unable to connect to any servers”

匿名 (未验证) 提交于 2019-12-03 02:49:01

问题:

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.

回答1:

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) 


回答2:

ProtocolError("cql_version '3.3.0' is not supported by remote (w/ native protocol). Supported versions: [u'3.2.0']" 

Indicates that there is a version mismatch between the C* version you are running and the python driver run by CQLSH. Make sure they are all out of the same release.



回答3:

I was facing a similar issue when I was executing bin/cqlsh. I was seeing the below error:

Connection error: ('Unable to connect to any servers', {'cassandra-1.alpha.mimosacloud.co': ProtocolError("cql_version '3.2.0' is not supported by remote (w/ native protocol). Supported versions: [u'3.2.1']",)}) 

My remote server was using cassandra 2.1.12 and I was trying to connect to it using the cqlsh bundeled with apache-cassandra-2.1.7. My problem was resolved when I downloaded apache-cassandra-2.1.12 from this link and used the cqlsh bundled with it.

Details of my server are: [cqlsh 5.0.1 | Cassandra 2.1.12 | CQL spec 3.2.1 | Native protocol v3]



回答4:

edit cqlsh.py file (you can find it using which cqlsh) and change the value of DEFAULT_CQLVER = 'z.z.z' to the supported version.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!