java 链接 cassandra_如何为远程连接配置cassandra

远程访问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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值