【问题标题】:CQLSH is not executing and Connection RefusedCQLSH 未执行且连接被拒绝
【发布时间】:2020-07-09 04:21:39
【问题描述】:

我无法执行 cqlsh 命令。我是卡桑德拉的新手。我遵循了以前的线程。仍然无法执行 cqlsh 命令。请帮我找出问题所在。这是我运行 CQLSH 时的错误,

[root@Kar bin]# cqlsh
Connection error: ('Unable to connect to any servers',
    {'127.0.0.1': error(111,
    "Tried connecting to [('127.0.0.1', 9042)]. 
     Last error: Connection refused")})

谢谢, 卡西克

【问题讨论】:

  • 检查 Cassandra 是否正在运行...您需要查看 system.log 以查找启动过程中是否有任何错误
  • 您也可能不想以 root 身份运行 cqlsh(或 Cassandra)。
  • 嗨,Alex,Cassandra 服务运行良好。
  • 嗨 Aaron,我尝试以 root 用户和 Cassandra 用户的身份运行 cqlsh。我仍然无法继续前进。

标签: cassandra cqlsh


【解决方案1】:

您的listen_addressbroadcast_address 的值是多少?

$ grep _address conf/cassandra.yaml | grep -v "\#"
listen_address: 169.254.93.1
rpc_address: 169.254.93.1

在我的例子中,169.254.93.1 是 Cassandra 将绑定在端口 9042 上的唯一地址。因此,仅运行 cqlsh(不指定 IP)只有在它们映射到 127.0.0.1 的主 IP 或localhost.

因此,我需要指定169.254.93.1 进行连接。

$ bin/cqlsh 169.254.93.1 -u flynn -p reindeerFlotilla
Connected to TheGrid at 169.254.93.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
flynn@cqlsh>

【讨论】:

  • 嗨 Aaron,请在下面找到 listen_address 和 rpc_address 条目,[root@Kar-Casa03 cassandra]# grep _address conf/cassandra.yaml | grep -v "\#" listen_address: 192.168.219.62 rpc_address: 192.168.219.62
  • [root@Kar-Casa03 cassandra]# grep _address conf/cassandra.yaml | grep -v "\#" listen_address: 192.168.219.62 rpc_address: 192.168.219.62 broadcast_rpc_address: 192.168.219.62
  • @Karthick 你试过执行cqlsh 192.168.219.62 吗?
  • 是的Aaron,我试过执行cqlsh 192.168.219.62。不幸的是还是一样
猜你喜欢
  • 2016-07-26
  • 2015-05-21
  • 2018-06-12
  • 2018-08-20
  • 2014-08-09
  • 2018-01-05
  • 2017-08-08
  • 2019-07-16
  • 1970-01-01
相关资源
最近更新 更多