【问题标题】:Unable to run cqlsh; Timed out creating connection无法运行 cqlsh;创建连接超时
【发布时间】:2015-06-22 06:17:34
【问题描述】:

我无法运行 cqlsh:

$ cqlsh  10.230.34.16 9160
Connection error: ('Unable to connect to any servers', {'10.230.34.16': OperationTimedOut('errors=Timed out creating connection, last_host=None',)})

rpc服务在9160上监听,但是cqlsh还是连接不上?

$ netstat -an |grep 9160| grep LISTEN
tcp        0      0 10.230.34.16:9160     0.0.0.0:*               LISTEN     

有什么我可以检查的想法吗?

我正在使用 datastax cassandra 2.1.0

【问题讨论】:

  • 2.1.0 中的 Cqlsh 不再使用 Thrift (9160),请确保端口 9042 可用。
  • 我的 start_native_transport 为 false,是否有原因默认为 false?
  • 开启 start_native_transport 后生效
  • 就我而言,5 的默认 connect-timeout 值是不够的。添加标志--connect-timeout 3600 --debug 解决了这个问题。

标签: cassandra datastax


【解决方案1】:
  1. 检查 cassandra.yaml 文件与 rpc_port 的行:通常默认 = 9160
  2. 登录到托管cassandra的机器
  3. 试试 cqlsh 127.0.0.1 9160 : 无论如何都应该没问题
  4. 尝试 cqlsh [IP of host] 9160 : 如果 ok 则 cassandra 可从 lan 访问,如果 ko 则 cassandra 无法从 lan 访问,但只能从 localhost 127.0.0.1 访问

【讨论】:

  • 根据我的经验,4点是在大多数情况下解决此类问题的点
【解决方案2】:

它有点老了,但以防万一有人遇到这个问题。

基于这个QNA,驱动和协议似乎发生了变化。 试试

cqlsh 127.0.0.1 9042

它为我解决了这个问题。

【讨论】:

    猜你喜欢
    • 2018-06-12
    • 2015-03-24
    • 2019-02-18
    • 1970-01-01
    • 2018-08-12
    • 2019-08-10
    • 2014-12-01
    • 2012-05-16
    • 2015-11-22
    相关资源
    最近更新 更多