accessing remote cassandra database - cassandra

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.

Related

unable to access CQLSH from .cmd locally on VM

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>

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.

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

Cant' connect to Cassandra with cqlsh

When i tried to connect to my cassandra cluster with cqlsh, i had this 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")})
So i go to the cassandra.yaml file but my rpc_adress and listen_address parameters are goods.
There is my listen_adress :
# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
listen_address: localhost
# listen_interface: eth0
# listen_interface_prefer_ipv6: false
And my rpc_address :
rpc_address: localhost
# port for Thrift to listen for clients on
rpc_port: 9160
I also tried to modify the file, but i dont have the right for it.
Thank you in advance

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