远程访问Cassandra是通过其Cassandra 2.0的旧货端口 . 在Cassandra 2.0.x中,默认的cqlsh监听端口是9160,由rpc_port参数在cassandra.yaml中定义 . 默认情况下,Cassandra 2.0.x及更早版本通过在cassandra.yaml文件中将start_rpc配置为true来启用Thrift .
在Cassandra 2.1中,cqlsh实用程序使用本机协议 . 在使用Datastax python驱动程序的Cassandra 2.1中,默认的cqlsh监听端口是9042 .
cassandra节点应绑定到服务器网卡的IP地址 - 它不应该是127.0.0.1或localhost,这是环回接口的IP,绑定到此将阻止直接远程访问 . 要配置绑定地址,请使用cassandra.yaml中的rpc_address参数 . 将其设置为0.0.0.0将侦听所有网络接口 .
您是否检查过远程计算机是否可以连接到Cassandra节点?机器之间是否有防火墙?您可以尝试以下步骤来测试它:
1) Ensure you can connect to that IP from the server you are on:
$ ssh user@xxx.xxx.xx.xx
2) Check the node's status and also confirm it shows the same IP:
$ nodetool状态
3) Run the command to connect with the IP (only specify the port if you are not using the default):
$ cqlsh xxx.xxx.xx.xx