Cassandra cqlsh - connection refused

前端 未结 20 1831
名媛妹妹
名媛妹妹 2020-12-01 11:50

I\'ve just started working with Cassandra (datastax), version 2.1.3 and cqlsh version 5.0.1.

Cassandra starts up fine and the cluster is operational instantly.

相关标签:
20条回答
  • 2020-12-01 12:16

    For me it turned out that the service wasn't running at all. Check with

    service cassandra status
    

    If you got the same error as I got, or another type, then messing around with IP addresses won't solve your problem at all.

    The error I got:

    cassandra dead but pid file exists
    

    Edit: This was the solution for my problem: https://stackoverflow.com/a/46743119/3881406

    0 讨论(0)
  • 2020-12-01 12:21

    Try to change the rpc_address to point to the node's IP instead of 0.0.0.0 and specify the IP while connecting to the cqlsh, as if the IP is 10.0.1.34 and the rpc_port left to the default value 9160 then the following should work:

    cqlsh 10.0.1.34 9160 
    

    Or:

    cqlsh 10.0.1.34 
    

    Also make sure that start_rpc is set to true in /etc/cassandra/cassandra.yaml configuration file.

    0 讨论(0)
  • 2020-12-01 12:22

    Look for native_transport_port in /etc/cassandra/cassandra.yaml The default is 9842.

    native_transport_port: 9842
    

    For connecting to localhost with cqlsh, this port worked for me.

    cqlsh 127.0.0.1 9842

    0 讨论(0)
  • 2020-12-01 12:23

    You need to edit cassandra.yaml on the node you are trying to connect to and set the node ip address for rpc_address and listen_address and restart Cassandra.

    rpc_address is the address on which Cassandra listens to the client calls.

    listen_address is the address on which Cassandra listens to the other Cassandra nodes.

    0 讨论(0)
  • 2020-12-01 12:23

    try changing the native_transport_protocol to port 9160 (if it is set to anything other than 9160; it might be pointing to 9042). Check your logs and see on which port cassandra is listening for CQL clients?

    0 讨论(0)
  • 2020-12-01 12:23

    First, you need to check the port 9042 whether this open or not if open then check below things like rpc_address and listen_address. you should set the server own IP address instead 0.0.0.0 or 127.0.0.1.

    If all okay then please run below command to connect cqlsh.

    cqlsh IP address 9042

    If you enable authentication and authorization you have to put user/pass with this command.

    0 讨论(0)
提交回复
热议问题