cqlsh连接被拒绝了

时间:2016-04-06 13:18:33

标签: cassandra connection cqlsh

当您收到Cassandra cqlsh Connection错误时,如下所示:

连接错误:('无法连接到任何服务器',{'127.0.0.1':错误(111,“尝试连接到[('127.0.0.1',9042)]。上次错误:连接被拒绝”) })

4 个答案:

答案 0 :(得分:1)

另一种解决方案,如果未设置为cqlsh <listen_address> [<port>]127.0.0.1,则输入localhost

答案 1 :(得分:1)

您也可以不使用IP地址进行连接 - 只需使用主机名: cqlsh'hostname -I'

答案 2 :(得分:0)

我遇到了与Cassandra 3.11.0相同的问题,无论何时我改变了rpc的地址或者监听地址cqlsh都行不通。我必须将相同的本地IP添加到seeds

所以经过反复试验,我的cassandra.yml看起来像是:

class-name: org.apache.cassandra.locator.SimpleSeedProvider
parameters: 
    -seeds: "192.168.0.30"

listen_adress: 192.168.0.30
rpc_address: 192.168.0.30

然后运行

cqlsh 192.168.0.30 9042

答案 3 :(得分:0)

当我安装Cassandra 3.11.1时,我遇到了这个问题。 我还发现如果我跑了

  

服务cassandra状态

,有一个

  

cassandra死了,但是pid文件存在

问题。它表示Cassandra服务无法启动 我检查了

  

/var/log/cassandra/cassandra.log

发现了这个错误:

  

启动时遇到异常......

。这是一个错误,已经报道过了。原始帖子链接https://issues.apache.org/jira/browse/CASSANDRA-14173

解决方案是将Cassandra降级为3.0

  1. 下载Cassandra rpm
  2.   卷曲-O   https://www.apache.org/dist/cassandra/redhat/30x/cassandra-3.0.15-1.noarch.rpm

      

    的wget   https://www.apache.org/dist/cassandra/redhat/30x/cassandra-3.0.15-1.noarch.rpm

    1. rpm -ivh cassandra-3.0.15-1.noarch.rpm
    2. service cassandra start
    3. 服务cassandra状态#check cassandra状态,应该说
    4.   

      cassandra(pid 1234)正在运行......

      1. cqlsh #start cassandra
      2. 希望这有助于你

相关问题