无法从其他主机连接到cassandra节点 [英] Can't connect to cassandra node from different host

查看:188
本文介绍了无法从其他主机连接到cassandra节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一台机器上有一个cassandra节点.当我从同一机器访问cqlsh时,它可以正常工作.

I have a cassandra node at a machine. When I access cqlsh from the same machne it works properly.

但是当我尝试使用另一台计算机上的"192.x.x.x"连接到它的cqlsh时,出现了错误提示

But when I tried to connect to it's cqlsh using "192.x.x.x" from another machine, I'm getting an error saying

连接错误:('无法连接到任何服务器',{'192.xxx':错误(111,尝试连接到[('192.xxx',9042)].)最后一个错误:连接被拒绝)})

Connection error: ('Unable to connect to any servers', {'192.x.x.x': error(111, "Tried connecting to [('192.x.x.x', 9042)]. Last error: Connection refused")})

这是什么原因?我该如何解决?

What is the reason for this? How can I fix it?

推荐答案

远程Cassandra节点可能未绑定到外部网络接口,而是绑定到了环回接口(这是默认配置).您可以通过使用远程计算机上的"telnet thecassandrahost 9042"来确保这一点,但它不起作用.

Probably the remote Cassandra node is not bound to the external network interface but to the loopback one (this is the default configuration). You can ensure this by using "telnet thecassandrahost 9042" from the remote machine, it should not work.

为了将Cassandra绑定到外部网络接口,您需要编辑cassandra.yaml配置文件,并将属性"listen_address"和"rpc_address"设置为远程IP或"0.0.0.0"(不是所有版本的Cassandra均支持通配符地址.

In order to bind Cassandra to the external network interface you need to edit the cassandra.yaml configuration file and set the properties "listen_address" and "rpc_address" to your remote IP or "0.0.0.0" (not all versions of Cassandra support wildcard addresses).

还要检查防火墙是否已正确配置或禁用(sudo服务iptables停止).

Check also that the firewall is properly configured or disabled (sudo service iptables stop).

这篇关于无法从其他主机连接到cassandra节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆