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.
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
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.
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
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.
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?
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.