Kam*_*Jha 3 cassandra cqlsh cassandra-2.0
我在使用端口9160通过localhost上的CQLSH连接到cassandra时遇到错误,尽管使用9042工作正常.以下是连接端口的输出.
cqlsh sj1glm800 9042 -u cassandra -p cassandra
Connected to ITCASSJ01 at sj1glm800:9042.
[cqlsh 5.0.1 | Cassandra 2.1.0 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh>
cqlsh sj1glm800 9160 -u cassandra -p cassandra
Connection error: ('Unable to connect to any servers', {'sj1glm800': ConnectionShutdown('Connection <AsyncoreConnection(40095120) sj1glm800:9160 (closed)> is already closed',)})
Run Code Online (Sandbox Code Playgroud)
谢谢,卡迈勒
您会看到此行为,因为在Cassandra 2.1及更高版本中,cqlsh实用程序使用本机二进制协议(默认情况下,它在端口9042上连接).对于Cassandra 2.0和之前的版本,cqlsh通过thrift在9160连接.因此,尝试使用Cassandra 2.1及更高版本连接端口9160(使用默认配置)将失败.
从cqlsh文档:
要求
在Cassandra 2.1中,cqlsh实用程序使用本机协议.在使用Datastax python驱动程序的Cassandra 2.1中,默认的cqlsh监听端口是9042.
在Cassandra 2.0中,cqlsh实用程序使用Thrift传输.在Cassandra 2.0.x中,默认的cqlsh监听端口是9160.
| 归档时间: |
|
| 查看次数: |
3022 次 |
| 最近记录: |