无法使用 cqlsh 连接到 Cassandra 远程主机

Can't connect to Cassandra remote host using cqlsh

我在 Ubuntu 服务器 14.04 的单个节点上安装了 cassandra 运行(IP 为 10.3.2.92,我通过 VPN 连接到服务器的同一网络)。文件 cassandra.yaml 中的以下参数已更改:

listen_address: 10.3.2.92
rpc_address: 10.3.2.92
- seeds: "10.3.2.92"

rpc_port: 9160 and native_transport_port: 9042, so they are set to default. 

当我在 OSX 我的机器上做的时候:

./cqlsh 10.3.2.92 9160

我收到以下错误:

Connection error: ('Unable to connect to any servers', {'10.3.2.92': error(None, "Tried connecting to [('10.3.2.92', 9042)]. Last error: timed out")})

启动 cassandra 后,我已经在服务器上尝试 nodetool enablethrift sudo service dse start,但没有成功。我也在9042端口试过。

我做错了什么?

提前致谢

编辑:

将 native_transport_port 更改为 8080 并且有效。我的专用网络管理员阻止了 9xxx 端口。

基本上 cqlsh 知道如何仅使用 9042 与节点通信。如果您对 9160 感兴趣,您应该使用 cassandra-cli 但此工具已被弃用。

无论如何,既然您尝试了 9042,我认为您还有其他一些网络问题。只是为了确保您可以尝试是否设法完成 telnet 10.3.2.92 9042 如果这不起作用,请检查节点上的防火墙设置。

cqlsh knows how to talk with a node by using 9042 only.

错了!

cqlsh host port -u username -p password

工作正常。

[cqlsh 5.0.1 | Cassandra 3.11.7 | CQL spec 3.4.4 | Native protocol v4]