unable to access CQLSH from .cmd locally on VM - cassandra

I am trying to connect with my Cassandra DB resides in a Windows VM but while executing the command cqlsh on Local command window. I am getting an exception:
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(10061, "Tried connecting to [('127.0.0.1', 9042)]. Last error: No connection could be made because the target machine actively refused it")})
I'm able to connect this cassandra cluster from my cloud platform 'Databricks' with it's public ip using Spark but on local system it is throwing the error.
Can anyone please help me on this?

in Cassandra configs, Check on which ip address you've bind your rpc calls to ?
if it's not localhost/127.0.0.1 then specify on which interface's ip you've bind it to..
then connect with specifying ip address -
cqlsh <ip address for rpcs calls>

Related

Connecting to cqlsh from remote fails, where as from localhost it connects?

Installed DSE on CentOS7 and saw no errors, I'm able to connect to cqlsh from the local machine and and I'm able to also do a telnet on the port.
However the problem is that when the same is done from a remote machine I get the below error
cqlsh XX.XXX.XX.XX 3389
Connection error: ('Unable to connect to any servers', {'10.223.61.49': ConnectionShutdown('Connection to 10.223.61.49 was closed',)})
To check the connectivity I did a telnet on this and see the below error
telnet XX.XXX.XX.XX 3389
Invalid or unsupported protocol version (13); supported versions are (3/v3, 4/v4, 5/v5-beta, 65/dse-v1)
I tried updating the Python version, also few tweaks to change the py script also didn't help

Not able to login to cqlsh in Cassandra cluster of 3 nodes hosted in Google cloud platform

I'm setting up a 3 node Cassandra cluster and after installing
cassandra I tried to connect to cassandra using 'cqlsh'
I'm not able to connect to cassandra db terminal.
rammady#deb-cassandra-ram-1:~$ cqlsh 10.142.0.76 Connection error:
('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried
connecting to [('127.0.0.1', 9042)]. Last error: Connection
refused")})
I've modified cassandra.yaml file and provided 1: private ip address
under seed -seed:10.142.0.75,10.142.0.76,10.142.0.77 2:
listen_address: 10.142.0.75 3: rpc_address: 10.142.0.75
You need to connect to the ip you defined in the config:
cqlsh 10.142.0.75
netstat -tulpn would show you, that the node is listening not on the loopback if.

accessing remote cassandra database

I am trying to access remote cassendra database by command:
cqlsh xx:x:x:x xxxx
got below error:
Connection error:
('Unable to connect to any servers',
{'xx:x:x:x': ConnectionShutdown('Connection to xx:x:x:x was closed',)
}
)
when I am trying to access localhost I am getting error:
command: cqlsh
error:
Connection error:
('Unable to connect to any servers',
{'127.0.0.1': error(111,
"Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")}
)
You need to check that Cassandra is accessible on the given IP & port that you specify in the command line. If you didn't change default ports, then you can use cqlsh IP. If it doesn't work, check that you don't have firewall that doesn't allow traffic to port 9042 on given IP.

CQLSH is not recognized in google cloud datastax cluster nodes

I have deployed a 4 node datastax cluster in GCP. I can ssh into each of the VM nodes but cqlsh is not recognized.Can you please help me to understand where I am going wrong
error:
Connection error: ('Unable to connect to any servers',
{'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1',
9042)]. Last error: Connection refused")})
If your cluster is working correctly, then the nodes must know about each other by their own IPs (internal or external). So Cassandra isn't configured to bind 9042 to 127.0.0.1, which means trying to cqlsh to 127.0.0.1:9042 won't work.
One way to check, would be just to do a nodetool status, and use one of those IP addresses. But, as you're on GCP, you may have both internal and external IP addresses, so in that case it really depends on which IP is set as your broadcast_rpc_address. You can check them all by grepping your cassandra.yaml.
$ grep "_address:" cassandra.yaml
listen_address: 192.168.1.3
broadcast_address: 10.20.15.1
# listen_on_broadcast_address: false
rpc_address: 192.168.1.3
broadcast_rpc_address: 10.20.15.1
In this case, your cqlsh command would look something like this:
cqlsh 10.20.15.1 -u youruser -p yourpassword

Unable to Connect to any Servers Error on Cassandra Seed Host

In my Cassandra 3-node setup, all the seed nodes are working fine. However, I am unable to connect to the seed host.
I get the following error:
Connection error: ('Unable to connect to any servers', {'127.0.0.1':
error(111,"Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
Please help.
NOTE: As you haven't specified which version of Cassandra you are running, or how you are attempting to connect to your cluster (cqlsh, Java client driver, etc...) I am going to make some assumptions here. For the future, that's good information to provide.
My guess is that if you were to run a nodetool status from one of your nodes, that you wouldn't see "127.0.0.1" in the list. Example:
$ nodetool status | grep 192.168 | awk '{ print $2 }'
192.168.1.1
192.168.1.2
192.168.1.3
My point, is that even if I am on 192.168.1.1, cqlsh 127.0.0.1 or cqlsh (without the IP) won't work. I need to specify the (non-localhost) IP address, which is probably going to be the value of your listen_address or rpc_address.

Resources