【问题标题】:CQLSH not connecting on 9160CQLSH 未连接到 9160
【发布时间】:2015-03-17 13:06:39
【问题描述】:

我在使用端口 9160 通过本地主机上的 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',)})

谢谢, 卡马尔

【问题讨论】:

    标签: cassandra cassandra-2.0 cqlsh


    【解决方案1】:

    您看到此行为是因为在 Cassandra 2.1 及更高版本中,cqlsh 实用程序使用本机二进制协议(默认情况下,连接到端口 9042)。对于 Cassandra 2.0 及更早版本,cqlsh 通过 thrift 连接 9160。因此,尝试使用 Cassandra 2.1 及更高版本在端口 9160(使用默认配置)上连接将失败。

    来自cqlsh documentation

    要求

    在 Cassandra 2.1 中,cqlsh 实用程序使用本地协议。在使用 Datastax python 驱动的 Cassandra 2.1 中,默认的 cqlsh 监听端口是 9042。

    在 Cassandra 2.0 中,cqlsh 实用程序使用 Thrift 传输。在 Cassandra 2.0.x,默认cqlsh监听端口为9160。

    【讨论】:

    • 我在 cqlsh 中使用 - cqlsh 9160 更改了 cassandra 2.1 的默认端口,但仍然无法连接到服务器并看到同样的问题。如何更改默认 cqlsh 端口?
    猜你喜欢
    • 2014-12-01
    • 2015-01-16
    • 2014-02-03
    • 1970-01-01
    • 2020-07-09
    • 2012-03-04
    • 2016-02-14
    • 2016-07-26
    • 2014-12-18
    相关资源
    最近更新 更多