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.
Had same problem recently after downgrade from Cassandra 3.0 to Cassandra 2.2 on ArchLinux.
Unlike above solutions my problem wasn't in .cassandra, but version 3.0 left its configuration in /var/lib/cassandra directory.
Following commands solved my problem:
sudo rm -R /var/lib/cassandra
sudo rm -R /var/log/cassandra
sudo rm -R /usr/share/cassandra
Then i installed cassandra and everything worked again :)
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.2.64 and the rpc_port left to the default value 9160 then the following should work:
cqlsh 10.0.2.64 9160
OR
cqlsh 10.0.2.64
Also make sure that start_rpc is set to true in /etc/cassandra/cassandra.yaml configuration file.
Check for correct IP address in the cassandra.yaml file. Majority of times the error is due to incorrect IP address of your system also the username and password too.
After doing so initiate cqlsh by the command :-
cqlsh 10.31.79.1 -u cassandra -p cassandra
Got into this issue for [cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]
had to set start_native_transport: true
in cassandra.yaml
file.
For verification,
tailf /var/log/cassandra/system.log
file in one-tab cassandra.yaml
sudo service cassandra restart
In logfile is shows.
INFO [main] 2019-03-15 19:53:06,156 Server.java:156 - Starting listening for CQL clients on /10.139.45.34:9042 (unencrypted)...
cqlsh --cqlversion="3.4.0" Connected to Test Cluster at 127.0.0.1:9042. [cqlsh 5.0.1 | Cassandra 3.0.9 | CQL spec 3.4.0 | Native protocol v4]
try the above command. It works for me.
Try to telnet to the given address. In my case, there was a firewall in place blocking me.