【问题标题】:Unable to connect to any servers Cassandra2无法连接到任何服务器 Cassandra2
【发布时间】:2017-04-13 19:33:51
【问题描述】:

在 Ubuntu 14.04 上使用 Datastax 4.8.11 Cassandra 2.1.17 一切正常,但突然不行了。 cqlsh 无法连接到服务器。 我成功启动了 dse 和 datastax-agent,它们运行良好,包括 cassandra。

@ubuntu:~$ cqlsh
    Connection error: ('Unable to connect to any servers', {'192.168.254.143': error(113, "Tried connecting to [('192.168.254.143', 9042)]. Last error: No route to host")})

在下面尝试但没有帮助

$ sudo service netwrok-manager restart

我认为这与 DHCP 有关 - 我的 VM IP 正在更改,并且与 Cassandra 配置中的 IP 不匹配(如何制作静态 IP?)。我尝试 cqlsh 为其提供新 IP:cqlsh 192.168.254.146 9160。我尝试了端口 9160 (rpc_port) 和 9042 (native_transport_port) 都不起作用(使用哪一个?)。但是错误消息现在不同了“连接被拒绝”(而不是没有到主机的路由)。

谢谢

【问题讨论】:

  • 将 .yaml rpc_address 和 listen_address 更新为 localhost,重新启动 Cassandra (DSE/datastax-agent)。现在 cqlsh 尝试转到 127.0.0.1/9042 - 但再次“连接被拒绝”

标签: cassandra-2.0 datastax-enterprise cqlsh


【解决方案1】:

在您的 cassandra.yaml 文件中您指定 IP 地址的位置: 'listen_address'、rpc_address' 和 'seeds' 你不必指定端口。 输入IP地址即可。

还要确保 cassandra 所需的所有端口都已打开 在终端上运行以下命令

iptables -I INPUT 1 -p tcp --dport 9042 -j ACCEPT

对以下端口执行此操作:9042,7000,7001,7199,9042,9160

【讨论】:

  • 谢谢你。只是为了确认它在我们的例子中只打开 9042 和 9160 有效。
猜你喜欢
  • 2018-10-08
  • 2016-01-05
  • 2017-02-16
  • 2016-03-02
  • 1970-01-01
  • 2016-12-17
  • 2022-07-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多