I have installed the Cassandra and not able to connect using cqlsh
:
[cassandra@linuxdr ~]$ which cassandra
/usr/sbin/cassandra
[cassandra@linuxdr ~]$ cassandra -v
4.0.5
[cassandra@linuxdr ~]$ sudo systemctl status cassandra.service
Active: active (running)
[cassandra@linuxdr ~]$ grep rpc_address /etc/cassandra/conf/cassandra.yaml
rpc_address: 192.168.56.9
[cassandra@linuxdr ~]$ sudo cqlsh 192.168.56.9 9042 -u cassandra -p cassandra
Connection error: ('Unable to connect to any servers', {'192.168.56.9:9042':
ConnectionRefusedError(111, "Tried connecting to [('192.168.56.9', 9042)]. Last error: Connection refused")})
[cassandra@linuxdr ~]$ netstat -an | grep 9042
[cassandra@linuxdr ~]$ telnet 192.168.56.9 9042
Trying 192.168.56.9... telnet: connect to address 192.168.56.9: Connection refused
How can I connect? Is there anything else I can try?
I am trying the nodetool from the same node
[cassandra@linuxdr ~]$ nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 192.168.56.9 168.15 KiB 16 100.0% rack1
[cassandra@linuxdr ~]$ sudo cqlsh 192.168.56.9 9042 -u cassandra -p cassandra
Connection error: ('Unable to connect to any servers', {'192.168.56.9:9042': ConnectionRefusedError(111, "Tried connecting to [('192.168.56.9', 9042)]. Last error: Connection refused")})
[cassandra@linuxdr ~]$ grep _address /etc/cassandra/conf/cassandra.yaml | grep -v '#'
listen_address: 192.168.56.9
rpc_address: 192.168.56.9
nodetool status
show the same IP or a different one?grep _address /etc/cassandra/conf/cassandra.yaml | grep -v "#"
. What other IPs do you see?